Add alternative expected output files for cs_CZ locale for btree_gist and
[PostgreSQL.git] / src / pl / plperl / expected / plperl_elog.out
blobfcb6e8d11e36b2464a0d4d83f891933602760b46
1 -- test warnings and errors from plperl
2 create or replace function perl_elog(text) returns void language plperl as $$
4   my $msg = shift;
5   elog(NOTICE,$msg);
7 $$;
8 select perl_elog('explicit elog');
9 NOTICE:  explicit elog
10  perl_elog 
11 -----------
13 (1 row)
15 create or replace function perl_warn(text) returns void language plperl as $$
17   my $msg = shift;
18   warn($msg);
20 $$;
21 select perl_warn('implicit elog via warn');
22 NOTICE:  implicit elog via warn at line 4.
24  perl_warn 
25 -----------
27 (1 row)
29 -- test strict mode on/off
30 SET plperl.use_strict = true;
31 create or replace function uses_global() returns text language plperl as $$
33   $global = 1;
34   $other_global = 2;
35   return 'uses_global worked';
37 $$;
38 ERROR:  creation of Perl function "uses_global" failed: Global symbol "$global" requires explicit package name at line 3.
39 Global symbol "$other_global" requires explicit package name at line 4.
40 select uses_global();
41 ERROR:  function uses_global() does not exist
42 LINE 1: select uses_global();
43                ^
44 HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
45 SET plperl.use_strict = false;
46 create or replace function uses_global() returns text language plperl as $$
48   $global = 1;
49   $other_global=2;
50   return 'uses_global worked';
52 $$;
53 select uses_global();
54     uses_global     
55 --------------------
56  uses_global worked
57 (1 row)