plperl_elog.out

来自「postgresql8.3.4源码,开源数据库」· OUT 代码 · 共 59 行

OUT
59
字号
-- test warnings and errors from plperlcreate or replace function perl_elog(text) returns void language plperl as $$  my $msg = shift;  elog(NOTICE,$msg);$$;select perl_elog('explicit elog');NOTICE:  explicit elog perl_elog ----------- (1 row)create or replace function perl_warn(text) returns void language plperl as $$  my $msg = shift;  warn($msg);$$;select perl_warn('implicit elog via warn');NOTICE:  implicit elog via warn at line 4. perl_warn ----------- (1 row)-- test strict mode on/offSET plperl.use_strict = true;create or replace function uses_global() returns text language plperl as $$  $global = 1;  $other_global = 2;  return 'uses_global worked';$$;ERROR:  creation of Perl function "uses_global" failed: Global symbol "$global" requires explicit package name at line 3.Global symbol "$other_global" requires explicit package name at line 4.select uses_global();ERROR:  function uses_global() does not existLINE 1: select uses_global();               ^HINT:  No function matches the given name and argument types. You might need to add explicit type casts.SET plperl.use_strict = false;create or replace function uses_global() returns text language plperl as $$  $global = 1;  $other_global=2;  return 'uses_global worked';$$;select uses_global();    uses_global     -------------------- uses_global worked(1 row)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?