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

« back to all changes in this revision

Viewing changes to src/pl/plperl/sql/plperl_elog.sql

  • 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
 
 
3
create or replace function perl_elog(text) returns void language plperl as $$
 
4
 
 
5
  my $msg = shift;
 
6
  elog(NOTICE,$msg);
 
7
 
 
8
$$;
 
9
 
 
10
select perl_elog('explicit elog');
 
11
 
 
12
create or replace function perl_warn(text) returns void language plperl as $$
 
13
 
 
14
  my $msg = shift;
 
15
  warn($msg);
 
16
 
 
17
$$;
 
18
 
 
19
select perl_warn('implicit elog via warn');
 
20
 
 
21
-- test strict mode on/off
 
22
 
 
23
SET plperl.use_strict = true;
 
24
 
 
25
create or replace function uses_global() returns text language plperl as $$
 
26
 
 
27
  $global = 1;
 
28
  $other_global = 2;
 
29
  return 'uses_global worked';
 
30
 
 
31
$$;
 
32
 
 
33
select uses_global();
 
34
 
 
35
SET plperl.use_strict = false;
 
36
 
 
37
create or replace function uses_global() returns text language plperl as $$
 
38
 
 
39
  $global = 1;
 
40
  $other_global=2;
 
41
  return 'uses_global worked';
 
42
 
 
43
$$;
 
44
 
 
45
select uses_global();