~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/pl/plperl/expected/plperl_elog.out

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- test warnings and errors from plperl
 
2
create or replace function perl_elog(text) returns void language plperl as $$
 
3
 
 
4
  my $msg = shift;
 
5
  elog(NOTICE,$msg);
 
6
 
 
7
$$;
 
8
select perl_elog('explicit elog');
 
9
NOTICE:  explicit elog
 
10
 perl_elog 
 
11
-----------
 
12
 
 
13
(1 row)
 
14
 
 
15
create or replace function perl_warn(text) returns void language plperl as $$
 
16
 
 
17
  my $msg = shift;
 
18
  warn($msg);
 
19
 
 
20
$$;
 
21
select perl_warn('implicit elog via warn');
 
22
NOTICE:  implicit elog via warn at line 4.
 
23
 
 
24
 perl_warn 
 
25
-----------
 
26
 
 
27
(1 row)
 
28
 
 
29
-- test strict mode on/off
 
30
SET plperl.use_strict = true;
 
31
create or replace function uses_global() returns text language plperl as $$
 
32
 
 
33
  $global = 1;
 
34
  $other_global = 2;
 
35
  return 'uses_global worked';
 
36
 
 
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 $$
 
47
 
 
48
  $global = 1;
 
49
  $other_global=2;
 
50
  return 'uses_global worked';
 
51
 
 
52
$$;
 
53
select uses_global();
 
54
    uses_global     
 
55
--------------------
 
56
 uses_global worked
 
57
(1 row)
 
58