2015-07-09 20:08 GMT+02:00 Merlin Moncure <[email protected]>:
> On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule <[email protected]>
> wrote:
> >
> > 2015-07-09 15:17 GMT+02:00 Merlin Moncure <[email protected]>:
> >>
> >> On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule <[email protected]
> >
> >> wrote:
> >> > Hi
> >> >
> >> > second version of this patch
> >> >
> >> > make check-world passed
> >>
> >> quickly scanning the patch, the implementation is trivial (minus
> >> regression test adjustments), and is, IMSNSHO, the right solution.
> >
> >
> > yes, it is right way - the behave of RAISE statement will be much more
> > cleaner
> >>
> >>
> >> Several of the source level comments need some minor wordsmithing and
> >> the GUCs are missing documentation. If we've got consensus on the
> >> approach, I'll pitch in on that.
> >
> > thank you
>
> revised patch attached. added GUC docs and cleaned up pg_settings
> language. Also tested patch and it works beautifully.
>
> Note, Pavel's patch does adjust default behavior to what we think is
> the "right" settings.
>
Thank you for documentation.
There is small error - default for client_min_context is error - not
notice. With this level a diff from regress tests is minimal. Default for
log_min_context should be warning.
Regards
Pavel
>
> merlin
>
diff --git a/contrib/dblink/expected/dblink.out b/contrib/dblink/expected/dblink.out
new file mode 100644
index a49b562..a268fc7
*** a/contrib/dblink/expected/dblink.out
--- b/contrib/dblink/expected/dblink.out
***************
*** 1,3 ****
--- 1,4 ----
+ set client_min_context TO notice;
CREATE EXTENSION dblink;
CREATE TABLE foo(f1 int, f2 text, f3 text[], primary key (f1,f2));
INSERT INTO foo VALUES (0,'a','{"a0","b0","c0"}');
diff --git a/contrib/dblink/sql/dblink.sql b/contrib/dblink/sql/dblink.sql
new file mode 100644
index ea78cc2..cf7e57e
*** a/contrib/dblink/sql/dblink.sql
--- b/contrib/dblink/sql/dblink.sql
***************
*** 1,3 ****
--- 1,5 ----
+ set client_min_context TO notice;
+
CREATE EXTENSION dblink;
CREATE TABLE foo(f1 int, f2 text, f3 text[], primary key (f1,f2));
diff --git a/contrib/hstore_plperl/expected/hstore_plperlu.out b/contrib/hstore_plperl/expected/hstore_plperlu.out
new file mode 100644
index 8c689ad..c97fd3f
*** a/contrib/hstore_plperl/expected/hstore_plperlu.out
--- b/contrib/hstore_plperl/expected/hstore_plperlu.out
*************** INFO: $VAR1 = {
*** 29,35 ****
'cc' => undef
};
- CONTEXT: PL/Perl function "test1"
test1
-------
2
--- 29,34 ----
*************** $$;
*** 46,52 ****
SELECT test1none('aa=>bb, cc=>NULL'::hstore);
INFO: $VAR1 = '"aa"=>"bb", "cc"=>NULL';
- CONTEXT: PL/Perl function "test1none"
test1none
-----------
0
--- 45,50 ----
*************** INFO: $VAR1 = {
*** 67,73 ****
'cc' => undef
};
- CONTEXT: PL/Perl function "test1list"
test1list
-----------
2
--- 65,70 ----
*************** $VAR2 = {
*** 92,98 ****
'dd' => 'ee'
};
- CONTEXT: PL/Perl function "test1arr"
test1arr
----------
2
--- 89,94 ----
*************** INFO: $VAR1 = {
*** 120,129 ****
'cc' => undef
};
- CONTEXT: PL/Perl function "test3"
INFO: $VAR1 = '"a"=>"1", "b"=>"boo", "c"=>NULL';
- CONTEXT: PL/Perl function "test3"
test3
-------
--- 116,123 ----
*************** INFO: $VAR1 = {
*** 161,167 ****
}
};
- CONTEXT: PL/Perl function "test4"
SELECT * FROM test1;
a | b
---+---------------------------------
--- 155,160 ----
diff --git a/contrib/hstore_plpython/expected/hstore_plpython.out b/contrib/hstore_plpython/expected/hstore_plpython.out
new file mode 100644
index b7a6a92..23091d3
*** a/contrib/hstore_plpython/expected/hstore_plpython.out
--- b/contrib/hstore_plpython/expected/hstore_plpython.out
*************** return len(val)
*** 13,19 ****
$$;
SELECT test1('aa=>bb, cc=>NULL'::hstore);
INFO: [('aa', 'bb'), ('cc', None)]
- CONTEXT: PL/Python function "test1"
test1
-------
2
--- 13,18 ----
*************** return len(val)
*** 32,38 ****
$$;
SELECT test1n('aa=>bb, cc=>NULL'::hstore);
INFO: [('aa', 'bb'), ('cc', None)]
- CONTEXT: PL/Python function "test1n"
test1n
--------
2
--- 31,36 ----
diff --git a/contrib/ltree_plpython/expected/ltree_plpython.out b/contrib/ltree_plpython/expected/ltree_plpython.out
new file mode 100644
index 934529e..c6e8a7c
*** a/contrib/ltree_plpython/expected/ltree_plpython.out
--- b/contrib/ltree_plpython/expected/ltree_plpython.out
*************** return len(val)
*** 9,15 ****
$$;
SELECT test1('aa.bb.cc'::ltree);
INFO: ['aa', 'bb', 'cc']
- CONTEXT: PL/Python function "test1"
test1
-------
3
--- 9,14 ----
*************** return len(val)
*** 24,30 ****
$$;
SELECT test1n('aa.bb.cc'::ltree);
INFO: ['aa', 'bb', 'cc']
- CONTEXT: PL/Python function "test1n"
test1n
--------
3
--- 23,28 ----
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index b91d6c7..6365d4a
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** local0.* /var/log/postgresql
*** 4144,4149 ****
--- 4144,4171 ----
<variablelist>
+ <varlistentry id="guc-client-min-context" xreflabel="client_min_context">
+ <term><varname>client_min_context</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>client_min_context</> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Controls which message levels include context when sent to the client.
+ Valid values are <literal>DEBUG5</>,
+ <literal>DEBUG4</>, <literal>DEBUG3</>, <literal>DEBUG2</>,
+ <literal>DEBUG1</>, <literal>LOG</>, <literal>NOTICE</>,
+ <literal>WARNING</>, <literal>ERROR</>, <literal>FATAL</>,
+ and <literal>PANIC</>. Each level
+ includes all the levels that follow it. The later the level,
+ the fewer messages are sent. The default is
+ <literal>ERROR</>. Note that <literal>LOG</> has a different
+ rank here than in <varname>log_min_messages</>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-client-min-messages" xreflabel="client_min_messages">
<term><varname>client_min_messages</varname> (<type>enum</type>)
<indexterm>
*************** local0.* /var/log/postgresql
*** 4165,4170 ****
--- 4187,4216 ----
</para>
</listitem>
</varlistentry>
+
+ <varlistentry id="guc-log-min-context" xreflabel="log_min_context">
+ <term><varname>log_min_context</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>log_min_context</> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Controls which message levels include context when written to
+ the server log.
+ Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
+ <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
+ <literal>INFO</>, <literal>NOTICE</>, <literal>WARNING</>,
+ <literal>ERROR</>, <literal>LOG</>, <literal>FATAL</>, and
+ <literal>PANIC</>. Each level includes all the levels that
+ follow it. The later the level, the fewer messages are sent
+ to the log. The default is <literal>WARNING</>. Note that
+ <literal>LOG</> has a different rank here than in
+ <varname>client_min_messages</>.
+ Only superusers can change this setting.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry id="guc-log-min-messages" xreflabel="log_min_messages">
<term><varname>log_min_messages</varname> (<type>enum</type>)
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
new file mode 100644
index 088c714..9445230
*** a/src/backend/utils/error/elog.c
--- b/src/backend/utils/error/elog.c
*************** write_csvlog(ErrorData *edata)
*** 2730,2736 ****
appendStringInfoChar(&buf, ',');
/* errcontext */
! if (!edata->hide_ctx)
appendCSVLiteral(&buf, edata->context);
appendStringInfoChar(&buf, ',');
--- 2730,2736 ----
appendStringInfoChar(&buf, ',');
/* errcontext */
! if (!edata->hide_ctx && edata->elevel >= log_min_context)
appendCSVLiteral(&buf, edata->context);
appendStringInfoChar(&buf, ',');
*************** send_message_to_server_log(ErrorData *ed
*** 2863,2869 ****
append_with_tabs(&buf, edata->internalquery);
appendStringInfoChar(&buf, '\n');
}
! if (edata->context && !edata->hide_ctx)
{
log_line_prefix(&buf, edata);
appendStringInfoString(&buf, _("CONTEXT: "));
--- 2863,2869 ----
append_with_tabs(&buf, edata->internalquery);
appendStringInfoChar(&buf, '\n');
}
! if (edata->context && !edata->hide_ctx && edata->elevel >= log_min_context)
{
log_line_prefix(&buf, edata);
appendStringInfoString(&buf, _("CONTEXT: "));
*************** send_message_to_frontend(ErrorData *edat
*** 3137,3143 ****
err_sendstring(&msgbuf, edata->hint);
}
! if (edata->context)
{
pq_sendbyte(&msgbuf, PG_DIAG_CONTEXT);
err_sendstring(&msgbuf, edata->context);
--- 3137,3143 ----
err_sendstring(&msgbuf, edata->hint);
}
! if (edata->context && edata->elevel >= client_min_context)
{
pq_sendbyte(&msgbuf, PG_DIAG_CONTEXT);
err_sendstring(&msgbuf, edata->context);
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
new file mode 100644
index 1bed525..cae8094
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
*************** bool Password_encryption = true;
*** 430,435 ****
--- 430,437 ----
int log_min_error_statement = ERROR;
int log_min_messages = WARNING;
int client_min_messages = NOTICE;
+ int log_min_context = WARNING;
+ int client_min_context = ERROR;
int log_min_duration_statement = -1;
int log_temp_files = -1;
int trace_recovery_messages = LOG;
*************** static struct config_enum ConfigureNames
*** 3426,3431 ****
--- 3428,3444 ----
},
{
+ {"client_min_context", PGC_USERSET, LOGGING_WHEN,
+ gettext_noop("Sets the message levels for which context is sent to the client."),
+ gettext_noop("Each level includes all the levels that follow it. The later"
+ " the level, the less context is sent.")
+ },
+ &client_min_context,
+ ERROR, client_message_level_options,
+ NULL, NULL, NULL
+ },
+
+ {
{"client_min_messages", PGC_USERSET, LOGGING_WHEN,
gettext_noop("Sets the message levels that are sent to the client."),
gettext_noop("Each level includes all the levels that follow it. The later"
*************** static struct config_enum ConfigureNames
*** 3478,3483 ****
--- 3491,3507 ----
NULL, NULL, NULL
},
+ {
+ {"log_min_context", PGC_SUSET, LOGGING_WHEN,
+ gettext_noop("Sets the message levels for which context is logged."),
+ gettext_noop("Each level includes all the levels that follow it. The later"
+ " the level, the less context is sent.")
+ },
+ &log_min_context,
+ WARNING, server_message_level_options,
+ NULL, NULL, NULL
+ },
+
{
{"log_min_messages", PGC_SUSET, LOGGING_WHEN,
gettext_noop("Sets the message levels that are logged."),
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
new file mode 100644
index 06dfc06..8695e8b
*** a/src/backend/utils/misc/postgresql.conf.sample
--- b/src/backend/utils/misc/postgresql.conf.sample
***************
*** 360,365 ****
--- 360,390 ----
# - When to Log -
+ #client_min_context = error # values in order of decreasing detail:
+ # debug5
+ # debug4
+ # debug3
+ # debug2
+ # debug1
+ # log
+ # notice
+ # warning
+ # error
+
+ #log_min_context = warning # values in order of decreasing detail:
+ # debug5
+ # debug4
+ # debug3
+ # debug2
+ # debug1
+ # info
+ # notice
+ # warning
+ # error
+ # log
+ # fatal
+ # panic
+
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
new file mode 100644
index dc167f9..f03a5e1
*** a/src/include/utils/guc.h
--- b/src/include/utils/guc.h
*************** extern PGDLLIMPORT bool check_function_b
*** 246,251 ****
--- 246,253 ----
extern bool default_with_oids;
extern bool SQL_inheritance;
+ extern int log_min_context;
+ extern int client_min_context;
extern int log_min_error_statement;
extern int log_min_messages;
extern int client_min_messages;
diff --git a/src/pl/plperl/expected/plperl.out b/src/pl/plperl/expected/plperl.out
new file mode 100644
index d23a302..14df5f4
*** a/src/pl/plperl/expected/plperl.out
--- b/src/pl/plperl/expected/plperl.out
*************** DO $$
*** 614,620 ****
elog(NOTICE, $a);
$$ LANGUAGE plperl;
NOTICE: This is a test
- CONTEXT: PL/Perl anonymous code block
-- check that restricted operations are rejected in a plperl DO block
DO $$ system("/nonesuch"); $$ LANGUAGE plperl;
ERROR: 'system' trapped by operation mask at line 1.
--- 614,619 ----
*************** CONTEXT: PL/Perl anonymous code block
*** 628,634 ****
-- check that eval is allowed and eval'd restricted ops are caught
DO $$ eval q{chdir '.';}; warn "Caught: $@"; $$ LANGUAGE plperl;
WARNING: Caught: 'chdir' trapped by operation mask at line 1.
- CONTEXT: PL/Perl anonymous code block
-- check that compiling do (dofile opcode) is allowed
-- but that executing it for a file not already loaded (via require) dies
DO $$ warn do "/dev/null"; $$ LANGUAGE plperl;
--- 627,632 ----
diff --git a/src/pl/plperl/expected/plperl_elog.out b/src/pl/plperl/expected/plperl_elog.out
new file mode 100644
index c447fa2..3f9449a
*** a/src/pl/plperl/expected/plperl_elog.out
--- b/src/pl/plperl/expected/plperl_elog.out
*************** create or replace function perl_elog(tex
*** 7,13 ****
$$;
select perl_elog('explicit elog');
NOTICE: explicit elog
- CONTEXT: PL/Perl function "perl_elog"
perl_elog
-----------
--- 7,12 ----
*************** create or replace function perl_warn(tex
*** 21,27 ****
$$;
select perl_warn('implicit elog via warn');
WARNING: implicit elog via warn at line 4.
- CONTEXT: PL/Perl function "perl_warn"
perl_warn
-----------
--- 20,25 ----
*************** select uses_global();
*** 61,67 ****
-- make sure we don't choke on readonly values
do language plperl $$ elog(NOTICE, ${^TAINT}); $$;
NOTICE: 0
- CONTEXT: PL/Perl anonymous code block
-- test recovery after "die"
create or replace function just_die() returns void language plperl AS $$
die "just die";
--- 59,64 ----
*************** return $a + $b;
*** 94,104 ****
$$;
select indirect_die_caller();
NOTICE: caught die
- CONTEXT: SQL statement "SELECT die_caller() AS fx"
- PL/Perl function "indirect_die_caller"
NOTICE: caught die
- CONTEXT: SQL statement "SELECT die_caller() AS fx"
- PL/Perl function "indirect_die_caller"
indirect_die_caller
---------------------
2
--- 91,97 ----
diff --git a/src/pl/plperl/expected/plperl_trigger.out b/src/pl/plperl/expected/plperl_trigger.out
new file mode 100644
index 36ecb92..5e3860e
*** a/src/pl/plperl/expected/plperl_trigger.out
--- b/src/pl/plperl/expected/plperl_trigger.out
*************** BEFORE INSERT OR UPDATE OR DELETE ON tri
*** 62,136 ****
FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo');
insert into trigger_test values(1,'insert', '("(1)")');
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['23', 'skidoo']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'INSERT'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{new} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'insert'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'BEFORE'
- CONTEXT: PL/Perl function "trigger_data"
update trigger_test set v = 'update' where i = 1;
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['23', 'skidoo']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'UPDATE'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{new} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'update'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{old} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'insert'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'BEFORE'
- CONTEXT: PL/Perl function "trigger_data"
delete from trigger_test;
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['23', 'skidoo']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'DELETE'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{old} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'update'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'BEFORE'
- CONTEXT: PL/Perl function "trigger_data"
DROP TRIGGER show_trigger_data_trig on trigger_test;
insert into trigger_test values(1,'insert', '("(1)")');
CREATE VIEW trigger_test_view AS SELECT * FROM trigger_test;
--- 62,102 ----
*************** INSTEAD OF INSERT OR UPDATE OR DELETE ON
*** 139,213 ****
FOR EACH ROW EXECUTE PROCEDURE trigger_data(24,'skidoo view');
insert into trigger_test_view values(2,'insert', '("(2)")');
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['24', 'skidoo view']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'INSERT'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{new} = {'foo' => {'rfoo' => {'i' => '2'}}, 'i' => '2', 'v' => 'insert'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'INSTEAD OF'
- CONTEXT: PL/Perl function "trigger_data"
update trigger_test_view set v = 'update', foo = '("(3)")' where i = 1;
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['24', 'skidoo view']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'UPDATE'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{new} = {'foo' => {'rfoo' => {'i' => '3'}}, 'i' => '1', 'v' => 'update'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{old} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'insert'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'INSTEAD OF'
- CONTEXT: PL/Perl function "trigger_data"
delete from trigger_test_view;
NOTICE: $_TD->{argc} = '2'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{args} = ['24', 'skidoo view']
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{event} = 'DELETE'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{level} = 'ROW'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{name} = 'show_trigger_data_trig'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{old} = {'foo' => {'rfoo' => {'i' => '1'}}, 'i' => '1', 'v' => 'insert'}
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relid} = 'bogus:12345'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{relname} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_name} = 'trigger_test_view'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{table_schema} = 'public'
- CONTEXT: PL/Perl function "trigger_data"
NOTICE: $_TD->{when} = 'INSTEAD OF'
- CONTEXT: PL/Perl function "trigger_data"
DROP VIEW trigger_test_view;
delete from trigger_test;
DROP FUNCTION trigger_data();
--- 105,145 ----
*************** create event trigger perl_b_snitch on dd
*** 319,346 ****
execute procedure perlsnitch();
create or replace function foobar() returns int language sql as $$select 1;$$;
NOTICE: perlsnitch: ddl_command_start CREATE FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
NOTICE: perlsnitch: ddl_command_end CREATE FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
alter function foobar() cost 77;
NOTICE: perlsnitch: ddl_command_start ALTER FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
NOTICE: perlsnitch: ddl_command_end ALTER FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
drop function foobar();
NOTICE: perlsnitch: ddl_command_start DROP FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
NOTICE: perlsnitch: ddl_command_end DROP FUNCTION
- CONTEXT: PL/Perl function "perlsnitch"
create table foo();
NOTICE: perlsnitch: ddl_command_start CREATE TABLE
- CONTEXT: PL/Perl function "perlsnitch"
NOTICE: perlsnitch: ddl_command_end CREATE TABLE
- CONTEXT: PL/Perl function "perlsnitch"
drop table foo;
NOTICE: perlsnitch: ddl_command_start DROP TABLE
- CONTEXT: PL/Perl function "perlsnitch"
NOTICE: perlsnitch: ddl_command_end DROP TABLE
- CONTEXT: PL/Perl function "perlsnitch"
drop event trigger perl_a_snitch;
drop event trigger perl_b_snitch;
--- 251,268 ----
diff --git a/src/pl/plperl/expected/plperlu.out b/src/pl/plperl/expected/plperlu.out
new file mode 100644
index 3daf4ce..a3edb38
*** a/src/pl/plperl/expected/plperlu.out
--- b/src/pl/plperl/expected/plperlu.out
*************** LOAD 'plperl';
*** 6,12 ****
SET plperl.on_plperlu_init = '$_SHARED{init} = 42';
DO $$ warn $_SHARED{init} $$ language plperlu;
WARNING: 42 at line 1.
- CONTEXT: PL/Perl anonymous code block
--
-- Test compilation of unicode regex - regardless of locale.
-- This code fails in plain plperl in a non-UTF8 database.
--- 6,11 ----
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
new file mode 100644
index 7d4001c..e1a6b7d
*** a/src/pl/plpgsql/src/pl_exec.c
--- b/src/pl/plpgsql/src/pl_exec.c
***************
*** 42,49 ****
#include "utils/typcache.h"
- static const char *const raise_skip_msg = "RAISE";
-
typedef struct
{
int nargs; /* number of arguments */
--- 42,47 ----
*************** plpgsql_exec_error_callback(void *arg)
*** 939,948 ****
{
PLpgSQL_execstate *estate = (PLpgSQL_execstate *) arg;
- /* if we are doing RAISE, don't report its location */
- if (estate->err_text == raise_skip_msg)
- return;
-
if (estate->err_text != NULL)
{
/*
--- 937,942 ----
*************** exec_stmt_raise(PLpgSQL_execstate *estat
*** 3158,3165 ****
/*
* Throw the error (may or may not come back)
*/
- estate->err_text = raise_skip_msg; /* suppress traceback of raise */
-
ereport(stmt->elog_level,
(err_code ? errcode(err_code) : 0,
errmsg_internal("%s", err_message),
--- 3152,3157 ----
diff --git a/src/pl/plpython/expected/plpython_do.out b/src/pl/plpython/expected/plpython_do.out
new file mode 100644
index 0977812..e300530
*** a/src/pl/plpython/expected/plpython_do.out
--- b/src/pl/plpython/expected/plpython_do.out
***************
*** 1,9 ****
DO $$ plpy.notice("This is plpythonu.") $$ LANGUAGE plpythonu;
NOTICE: This is plpythonu.
- CONTEXT: PL/Python anonymous code block
DO $$ plpy.notice("This is plpython2u.") $$ LANGUAGE plpython2u;
NOTICE: This is plpython2u.
- CONTEXT: PL/Python anonymous code block
DO $$ raise Exception("error test") $$ LANGUAGE plpythonu;
ERROR: Exception: error test
CONTEXT: Traceback (most recent call last):
--- 1,7 ----
diff --git a/src/pl/plpython/expected/plpython_error.out b/src/pl/plpython/expected/plpython_error.out
new file mode 100644
index be2ec97..1f52af7
*** a/src/pl/plpython/expected/plpython_error.out
--- b/src/pl/plpython/expected/plpython_error.out
*************** return None
*** 108,114 ****
LANGUAGE plpythonu;
SELECT invalid_type_caught('rick');
NOTICE: type "test" does not exist
- CONTEXT: PL/Python function "invalid_type_caught"
invalid_type_caught
---------------------
--- 108,113 ----
*************** return "you''ve been warned"
*** 232,238 ****
LANGUAGE plpythonu;
SELECT nested_warning();
WARNING: boom
- CONTEXT: PL/Python function "nested_warning"
nested_warning
--------------------
you've been warned
--- 231,236 ----
*************** SELECT specific_exception(2);
*** 336,342 ****
SELECT specific_exception(NULL);
NOTICE: Violated the NOT NULL constraint, sqlstate 23502
- CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------
--- 334,339 ----
*************** CONTEXT: PL/Python function "specific_e
*** 344,350 ****
SELECT specific_exception(2);
NOTICE: Violated the UNIQUE constraint, sqlstate 23505
- CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------
--- 341,346 ----
diff --git a/src/pl/plpython/expected/plpython_spi.out b/src/pl/plpython/expected/plpython_spi.out
new file mode 100644
index e2861df..e715ee5
*** a/src/pl/plpython/expected/plpython_spi.out
--- b/src/pl/plpython/expected/plpython_spi.out
*************** else:
*** 130,142 ****
$$ LANGUAGE plpythonu;
SELECT result_metadata_test($$SELECT 1 AS foo, '11'::text AS bar UNION SELECT 2, '22'$$);
INFO: True
- CONTEXT: PL/Python function "result_metadata_test"
INFO: ['foo', 'bar']
- CONTEXT: PL/Python function "result_metadata_test"
INFO: [23, 25]
- CONTEXT: PL/Python function "result_metadata_test"
INFO: [-1, -1]
- CONTEXT: PL/Python function "result_metadata_test"
result_metadata_test
----------------------
2
--- 130,138 ----
*************** CONTEXT: PL/Python function "result_met
*** 144,150 ****
SELECT result_metadata_test($$CREATE TEMPORARY TABLE foo1 (a int, b text)$$);
INFO: True
- CONTEXT: PL/Python function "result_metadata_test"
ERROR: plpy.Error: command did not produce a result set
CONTEXT: Traceback (most recent call last):
PL/Python function "result_metadata_test", line 6, in <module>
--- 140,145 ----
*************** else:
*** 234,248 ****
$$ LANGUAGE plpythonu;
SELECT result_subscript_test();
INFO: 2
- CONTEXT: PL/Python function "result_subscript_test"
INFO: 4
- CONTEXT: PL/Python function "result_subscript_test"
INFO: [2, 3]
- CONTEXT: PL/Python function "result_subscript_test"
INFO: [1, 3]
- CONTEXT: PL/Python function "result_subscript_test"
INFO: [10, 100, 3, 1000]
- CONTEXT: PL/Python function "result_subscript_test"
result_subscript_test
-----------------------
--- 229,238 ----
*************** plpy.info(result[:])
*** 257,263 ****
$$ LANGUAGE plpythonu;
SELECT result_empty_test();
INFO: []
- CONTEXT: PL/Python function "result_empty_test"
result_empty_test
-------------------
--- 247,252 ----
diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out
new file mode 100644
index ced4682..635bac6
*** a/src/pl/plpython/expected/plpython_subtransaction.out
--- b/src/pl/plpython/expected/plpython_subtransaction.out
*************** SELECT * FROM subtransaction_tbl;
*** 154,160 ****
TRUNCATE subtransaction_tbl;
SELECT subtransaction_nested_test('t');
NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
- CONTEXT: PL/Python function "subtransaction_nested_test"
subtransaction_nested_test
----------------------------
ok
--- 154,159 ----
*************** return "ok"
*** 180,188 ****
$$ LANGUAGE plpythonu;
SELECT subtransaction_deeply_nested_test();
NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
- CONTEXT: PL/Python function "subtransaction_nested_test"
- SQL statement "SELECT subtransaction_nested_test('t')"
- PL/Python function "subtransaction_nested_test"
subtransaction_deeply_nested_test
-----------------------------------
ok
--- 179,184 ----
*************** CONTEXT: Traceback (most recent call la
*** 251,257 ****
PL/Python function "subtransaction_exit_without_enter"
SELECT subtransaction_enter_without_exit();
WARNING: forcibly aborting a subtransaction that has not been exited
- CONTEXT: PL/Python function "subtransaction_enter_without_exit"
subtransaction_enter_without_exit
-----------------------------------
--- 247,252 ----
*************** CONTEXT: PL/Python function "subtransac
*** 259,265 ****
SELECT subtransaction_exit_twice();
WARNING: forcibly aborting a subtransaction that has not been exited
- CONTEXT: PL/Python function "subtransaction_exit_twice"
ERROR: ValueError: this subtransaction has not been entered
CONTEXT: Traceback (most recent call last):
PL/Python function "subtransaction_exit_twice", line 3, in <module>
--- 254,259 ----
*************** CONTEXT: Traceback (most recent call la
*** 267,275 ****
PL/Python function "subtransaction_exit_twice"
SELECT subtransaction_enter_twice();
WARNING: forcibly aborting a subtransaction that has not been exited
- CONTEXT: PL/Python function "subtransaction_enter_twice"
WARNING: forcibly aborting a subtransaction that has not been exited
- CONTEXT: PL/Python function "subtransaction_enter_twice"
subtransaction_enter_twice
----------------------------
--- 261,267 ----
*************** CONTEXT: Traceback (most recent call la
*** 283,289 ****
PL/Python function "subtransaction_exit_same_subtransaction_twice"
SELECT subtransaction_enter_same_subtransaction_twice();
WARNING: forcibly aborting a subtransaction that has not been exited
- CONTEXT: PL/Python function "subtransaction_enter_same_subtransaction_twice"
ERROR: ValueError: this subtransaction has already been entered
CONTEXT: Traceback (most recent call last):
PL/Python function "subtransaction_enter_same_subtransaction_twice", line 4, in <module>
--- 275,280 ----
*************** except plpy.SPIError:
*** 329,337 ****
$$ LANGUAGE plpythonu;
SELECT subtransaction_mix_explicit_and_implicit();
WARNING: Caught a SPI error from an explicit subtransaction
- CONTEXT: PL/Python function "subtransaction_mix_explicit_and_implicit"
WARNING: Caught a SPI error
- CONTEXT: PL/Python function "subtransaction_mix_explicit_and_implicit"
subtransaction_mix_explicit_and_implicit
------------------------------------------
--- 320,326 ----
*************** with plpy.subtransaction():
*** 370,376 ****
$$ LANGUAGE plpythonu;
SELECT try_catch_inside_subtransaction();
NOTICE: caught
- CONTEXT: PL/Python function "try_catch_inside_subtransaction"
try_catch_inside_subtransaction
---------------------------------
--- 359,364 ----
*************** with plpy.subtransaction():
*** 395,401 ****
$$ LANGUAGE plpythonu;
SELECT pk_violation_inside_subtransaction();
NOTICE: caught
- CONTEXT: PL/Python function "pk_violation_inside_subtransaction"
pk_violation_inside_subtransaction
------------------------------------
--- 383,388 ----
diff --git a/src/pl/plpython/expected/plpython_test.out b/src/pl/plpython/expected/plpython_test.out
new file mode 100644
index a884fc0..7b76faf
*** a/src/pl/plpython/expected/plpython_test.out
--- b/src/pl/plpython/expected/plpython_test.out
*************** plpy.error('error')
*** 62,78 ****
$$ LANGUAGE plpythonu;
SELECT elog_test();
INFO: info
- CONTEXT: PL/Python function "elog_test"
INFO: 37
- CONTEXT: PL/Python function "elog_test"
INFO: ()
- CONTEXT: PL/Python function "elog_test"
INFO: ('info', 37, [1, 2, 3])
- CONTEXT: PL/Python function "elog_test"
NOTICE: notice
- CONTEXT: PL/Python function "elog_test"
WARNING: warning
- CONTEXT: PL/Python function "elog_test"
ERROR: plpy.Error: error
CONTEXT: Traceback (most recent call last):
PL/Python function "elog_test", line 10, in <module>
--- 62,72 ----
diff --git a/src/pl/plpython/expected/plpython_trigger.out b/src/pl/plpython/expected/plpython_trigger.out
new file mode 100644
index 80e478b..4148963
*** a/src/pl/plpython/expected/plpython_trigger.out
--- b/src/pl/plpython/expected/plpython_trigger.out
*************** BEFORE INSERT OR UPDATE OR DELETE OR TRU
*** 98,305 ****
FOR EACH STATEMENT EXECUTE PROCEDURE trigger_data(23,'skidoo');
insert into trigger_test values(1,'insert');
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => INSERT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => STATEMENT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_stmt
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => INSERT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_before
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => INSERT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_after
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => AFTER
- CONTEXT: PL/Python function "trigger_data"
update trigger_test set v = 'update' where i = 1;
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => UPDATE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => STATEMENT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_stmt
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => UPDATE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_before
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 1, 'v': 'update'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => UPDATE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_after
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 1, 'v': 'update'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => AFTER
- CONTEXT: PL/Python function "trigger_data"
delete from trigger_test;
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => DELETE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => STATEMENT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_stmt
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => DELETE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_before
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'update'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => DELETE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_after
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'update'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => AFTER
- CONTEXT: PL/Python function "trigger_data"
truncate table trigger_test;
NOTICE: TD[args] => ['23', 'skidoo']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => TRUNCATE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => STATEMENT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig_stmt
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => BEFORE
- CONTEXT: PL/Python function "trigger_data"
DROP TRIGGER show_trigger_data_trig_stmt on trigger_test;
DROP TRIGGER show_trigger_data_trig_before on trigger_test;
DROP TRIGGER show_trigger_data_trig_after on trigger_test;
--- 98,205 ----
*************** INSTEAD OF INSERT OR UPDATE OR DELETE ON
*** 310,376 ****
FOR EACH ROW EXECUTE PROCEDURE trigger_data(24,'skidoo view');
insert into trigger_test_view values(2,'insert');
NOTICE: TD[args] => ['24', 'skidoo view']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => INSERT
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 2, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test_view
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => INSTEAD OF
- CONTEXT: PL/Python function "trigger_data"
update trigger_test_view set v = 'update' where i = 1;
NOTICE: TD[args] => ['24', 'skidoo view']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => UPDATE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => {'i': 1, 'v': 'update'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test_view
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => INSTEAD OF
- CONTEXT: PL/Python function "trigger_data"
delete from trigger_test_view;
NOTICE: TD[args] => ['24', 'skidoo view']
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[event] => DELETE
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[level] => ROW
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[name] => show_trigger_data_trig
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[new] => None
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[old] => {'i': 1, 'v': 'insert'}
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[relid] => bogus:12345
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_name] => trigger_test_view
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[table_schema] => public
- CONTEXT: PL/Python function "trigger_data"
NOTICE: TD[when] => INSTEAD OF
- CONTEXT: PL/Python function "trigger_data"
DROP FUNCTION trigger_data() CASCADE;
NOTICE: drop cascades to trigger show_trigger_data_trig on view trigger_test_view
DROP VIEW trigger_test_view;
--- 210,246 ----
*************** BEFORE DELETE ON trigger_test
*** 402,408 ****
FOR EACH ROW EXECUTE PROCEDURE stupid2();
DELETE FROM trigger_test WHERE i = 0;
WARNING: PL/Python trigger function returned "MODIFY" in a DELETE trigger -- ignored
- CONTEXT: PL/Python function "stupid2"
DROP TRIGGER stupid_trigger2 ON trigger_test;
INSERT INTO trigger_test VALUES (0, 'zero');
-- returning unrecognized string from trigger function
--- 272,277 ----
diff --git a/src/pl/plpython/expected/plpython_types.out b/src/pl/plpython/expected/plpython_types.out
new file mode 100644
index 17057a5..f0b6abd
*** a/src/pl/plpython/expected/plpython_types.out
--- b/src/pl/plpython/expected/plpython_types.out
*************** return x
*** 10,16 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_bool(true);
INFO: (True, <type 'bool'>)
- CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
t
--- 10,15 ----
*************** CONTEXT: PL/Python function "test_type_
*** 18,24 ****
SELECT * FROM test_type_conversion_bool(false);
INFO: (False, <type 'bool'>)
- CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
f
--- 17,22 ----
*************** CONTEXT: PL/Python function "test_type_
*** 26,32 ****
SELECT * FROM test_type_conversion_bool(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
--- 24,29 ----
*************** return ret
*** 54,60 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_bool_other(0);
INFO: (0, False)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
f
--- 51,56 ----
*************** CONTEXT: PL/Python function "test_type_
*** 62,68 ****
SELECT * FROM test_type_conversion_bool_other(1);
INFO: (5, True)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
t
--- 58,63 ----
*************** CONTEXT: PL/Python function "test_type_
*** 70,76 ****
SELECT * FROM test_type_conversion_bool_other(2);
INFO: ('', False)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
f
--- 65,70 ----
*************** CONTEXT: PL/Python function "test_type_
*** 78,84 ****
SELECT * FROM test_type_conversion_bool_other(3);
INFO: ('fa', True)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
t
--- 72,77 ----
*************** CONTEXT: PL/Python function "test_type_
*** 86,92 ****
SELECT * FROM test_type_conversion_bool_other(4);
INFO: ([], False)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
f
--- 79,84 ----
*************** CONTEXT: PL/Python function "test_type_
*** 94,100 ****
SELECT * FROM test_type_conversion_bool_other(5);
INFO: ([0], True)
- CONTEXT: PL/Python function "test_type_conversion_bool_other"
test_type_conversion_bool_other
---------------------------------
t
--- 86,91 ----
*************** return x
*** 106,112 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_char('a');
INFO: ('a', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_char"
test_type_conversion_char
---------------------------
a
--- 97,102 ----
*************** CONTEXT: PL/Python function "test_type_
*** 114,120 ****
SELECT * FROM test_type_conversion_char(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_char"
test_type_conversion_char
---------------------------
--- 104,109 ----
*************** return x
*** 126,132 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_int2(100::int2);
INFO: (100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
100
--- 115,120 ----
*************** CONTEXT: PL/Python function "test_type_
*** 134,140 ****
SELECT * FROM test_type_conversion_int2(-100::int2);
INFO: (-100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
-100
--- 122,127 ----
*************** CONTEXT: PL/Python function "test_type_
*** 142,148 ****
SELECT * FROM test_type_conversion_int2(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
--- 129,134 ----
*************** return x
*** 154,160 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_int4(100);
INFO: (100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
100
--- 140,145 ----
*************** CONTEXT: PL/Python function "test_type_
*** 162,168 ****
SELECT * FROM test_type_conversion_int4(-100);
INFO: (-100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
-100
--- 147,152 ----
*************** CONTEXT: PL/Python function "test_type_
*** 170,176 ****
SELECT * FROM test_type_conversion_int4(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
--- 154,159 ----
*************** return x
*** 182,188 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_int8(100);
INFO: (100L, <type 'long'>)
- CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
100
--- 165,170 ----
*************** CONTEXT: PL/Python function "test_type_
*** 190,196 ****
SELECT * FROM test_type_conversion_int8(-100);
INFO: (-100L, <type 'long'>)
- CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
-100
--- 172,177 ----
*************** CONTEXT: PL/Python function "test_type_
*** 198,204 ****
SELECT * FROM test_type_conversion_int8(5000000000);
INFO: (5000000000L, <type 'long'>)
- CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
5000000000
--- 179,184 ----
*************** CONTEXT: PL/Python function "test_type_
*** 206,212 ****
SELECT * FROM test_type_conversion_int8(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
--- 186,191 ----
*************** return x
*** 220,226 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_numeric(100);
INFO: ('100', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
100
--- 199,204 ----
*************** CONTEXT: PL/Python function "test_type_
*** 228,234 ****
SELECT * FROM test_type_conversion_numeric(-100);
INFO: ('-100', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
-100
--- 206,211 ----
*************** CONTEXT: PL/Python function "test_type_
*** 236,242 ****
SELECT * FROM test_type_conversion_numeric(100.0);
INFO: ('100.0', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
100.0
--- 213,218 ----
*************** CONTEXT: PL/Python function "test_type_
*** 244,250 ****
SELECT * FROM test_type_conversion_numeric(100.00);
INFO: ('100.00', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
100.00
--- 220,225 ----
*************** CONTEXT: PL/Python function "test_type_
*** 252,258 ****
SELECT * FROM test_type_conversion_numeric(5000000000.5);
INFO: ('5000000000.5', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
5000000000.5
--- 227,232 ----
*************** CONTEXT: PL/Python function "test_type_
*** 260,266 ****
SELECT * FROM test_type_conversion_numeric(1234567890.0987654321);
INFO: ('1234567890.0987654321', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
1234567890.0987654321
--- 234,239 ----
*************** CONTEXT: PL/Python function "test_type_
*** 268,274 ****
SELECT * FROM test_type_conversion_numeric(-1234567890.0987654321);
INFO: ('-1234567890.0987654321', 'Decimal')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
-1234567890.0987654321
--- 241,246 ----
*************** CONTEXT: PL/Python function "test_type_
*** 276,282 ****
SELECT * FROM test_type_conversion_numeric(null);
INFO: ('None', 'NoneType')
- CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
--- 248,253 ----
*************** return x
*** 288,294 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_float4(100);
INFO: (100.0, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
100
--- 259,264 ----
*************** CONTEXT: PL/Python function "test_type_
*** 296,302 ****
SELECT * FROM test_type_conversion_float4(-100);
INFO: (-100.0, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
-100
--- 266,271 ----
*************** CONTEXT: PL/Python function "test_type_
*** 304,310 ****
SELECT * FROM test_type_conversion_float4(5000.5);
INFO: (5000.5, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
5000.5
--- 273,278 ----
*************** CONTEXT: PL/Python function "test_type_
*** 312,318 ****
SELECT * FROM test_type_conversion_float4(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
--- 280,285 ----
*************** return x
*** 324,330 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_float8(100);
INFO: (100.0, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
100
--- 291,296 ----
*************** CONTEXT: PL/Python function "test_type_
*** 332,338 ****
SELECT * FROM test_type_conversion_float8(-100);
INFO: (-100.0, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
-100
--- 298,303 ----
*************** CONTEXT: PL/Python function "test_type_
*** 340,346 ****
SELECT * FROM test_type_conversion_float8(5000000000.5);
INFO: (5000000000.5, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
5000000000.5
--- 305,310 ----
*************** CONTEXT: PL/Python function "test_type_
*** 348,354 ****
SELECT * FROM test_type_conversion_float8(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
--- 312,317 ----
*************** CONTEXT: PL/Python function "test_type_
*** 356,362 ****
SELECT * FROM test_type_conversion_float8(100100100.654321);
INFO: (100100100.654321, <type 'float'>)
- CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
100100100.654321
--- 319,324 ----
*************** return x
*** 368,374 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_oid(100);
INFO: (100L, <type 'long'>)
- CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
100
--- 330,335 ----
*************** CONTEXT: PL/Python function "test_type_
*** 376,382 ****
SELECT * FROM test_type_conversion_oid(2147483649);
INFO: (2147483649L, <type 'long'>)
- CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
2147483649
--- 337,342 ----
*************** CONTEXT: PL/Python function "test_type_
*** 384,390 ****
SELECT * FROM test_type_conversion_oid(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
--- 344,349 ----
*************** return x
*** 396,402 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_text('hello world');
INFO: ('hello world', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_text"
test_type_conversion_text
---------------------------
hello world
--- 355,360 ----
*************** CONTEXT: PL/Python function "test_type_
*** 404,410 ****
SELECT * FROM test_type_conversion_text(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_text"
test_type_conversion_text
---------------------------
--- 362,367 ----
*************** return x
*** 416,422 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_bytea('hello world');
INFO: ('hello world', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
\x68656c6c6f20776f726c64
--- 373,378 ----
*************** CONTEXT: PL/Python function "test_type_
*** 424,430 ****
SELECT * FROM test_type_conversion_bytea(E'null\\000byte');
INFO: ('null\x00byte', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
\x6e756c6c0062797465
--- 380,385 ----
*************** CONTEXT: PL/Python function "test_type_
*** 432,438 ****
SELECT * FROM test_type_conversion_bytea(null);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
--- 387,392 ----
*************** return y
*** 481,487 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_uint2(100::uint2, 50);
INFO: (100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_uint2"
test_type_conversion_uint2
----------------------------
50
--- 435,440 ----
*************** CONTEXT: PL/Python function "test_type_
*** 489,501 ****
SELECT * FROM test_type_conversion_uint2(100::uint2, -50);
INFO: (100, <type 'int'>)
- CONTEXT: PL/Python function "test_type_conversion_uint2"
ERROR: value for domain uint2 violates check constraint "uint2_check"
CONTEXT: while creating return value
PL/Python function "test_type_conversion_uint2"
SELECT * FROM test_type_conversion_uint2(null, 1);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_uint2"
test_type_conversion_uint2
----------------------------
1
--- 442,452 ----
*************** return y
*** 524,530 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_bytea10('hello wold', 'hello wold');
INFO: ('hello wold', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea10"
test_type_conversion_bytea10
------------------------------
\x68656c6c6f20776f6c64
--- 475,480 ----
*************** SELECT * FROM test_type_conversion_bytea
*** 534,540 ****
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
SELECT * FROM test_type_conversion_bytea10('hello word', 'hello world');
INFO: ('hello word', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea10"
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
CONTEXT: while creating return value
PL/Python function "test_type_conversion_bytea10"
--- 484,489 ----
*************** SELECT * FROM test_type_conversion_bytea
*** 542,548 ****
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
SELECT * FROM test_type_conversion_bytea10('hello word', null);
INFO: ('hello word', <type 'str'>)
- CONTEXT: PL/Python function "test_type_conversion_bytea10"
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
CONTEXT: while creating return value
PL/Python function "test_type_conversion_bytea10"
--- 491,496 ----
*************** return x
*** 555,561 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_array_int4(ARRAY[0, 100]);
INFO: ([0, 100], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{0,100}
--- 503,508 ----
*************** CONTEXT: PL/Python function "test_type_
*** 563,569 ****
SELECT * FROM test_type_conversion_array_int4(ARRAY[0,-100,55]);
INFO: ([0, -100, 55], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{0,-100,55}
--- 510,515 ----
*************** CONTEXT: PL/Python function "test_type_
*** 571,577 ****
SELECT * FROM test_type_conversion_array_int4(ARRAY[NULL,1]);
INFO: ([None, 1], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{NULL,1}
--- 517,522 ----
*************** CONTEXT: PL/Python function "test_type_
*** 579,585 ****
SELECT * FROM test_type_conversion_array_int4(ARRAY[]::integer[]);
INFO: ([], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{}
--- 524,529 ----
*************** CONTEXT: PL/Python function "test_type_
*** 587,593 ****
SELECT * FROM test_type_conversion_array_int4(NULL);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
--- 531,536 ----
*************** return x
*** 603,609 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_array_text(ARRAY['foo', 'bar']);
INFO: (['foo', 'bar'], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_text"
test_type_conversion_array_text
---------------------------------
{foo,bar}
--- 546,551 ----
*************** return x
*** 615,621 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_array_bytea(ARRAY[E'\\xdeadbeef'::bytea, NULL]);
INFO: (['\xde\xad\xbe\xef', None], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_bytea"
test_type_conversion_array_bytea
----------------------------------
{"\\xdeadbeef",NULL}
--- 557,562 ----
*************** return x
*** 681,687 ****
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_array_domain(ARRAY[0, 100]::ordered_pair_domain);
INFO: ([0, 100], <type 'list'>)
- CONTEXT: PL/Python function "test_type_conversion_array_domain"
test_type_conversion_array_domain
-----------------------------------
{0,100}
--- 622,627 ----
*************** CONTEXT: PL/Python function "test_type_
*** 689,695 ****
SELECT * FROM test_type_conversion_array_domain(NULL::ordered_pair_domain);
INFO: (None, <type 'NoneType'>)
- CONTEXT: PL/Python function "test_type_conversion_array_domain"
test_type_conversion_array_domain
-----------------------------------
--- 629,634 ----
*************** return rv[0]['val']
*** 783,789 ****
$$;
SELECT test_prep_bool_output(); -- false
INFO: {'val': False}
- CONTEXT: PL/Python function "test_prep_bool_output"
test_prep_bool_output
-----------------------
f
--- 722,727 ----
*************** return rv[0]['val']
*** 812,818 ****
$$;
SELECT test_prep_bytea_output();
INFO: {'val': '\xaa\x00\xbb'}
- CONTEXT: PL/Python function "test_prep_bytea_output"
test_prep_bytea_output
------------------------
\xaa00bb
--- 750,755 ----
diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out
new file mode 100644
index 5e31737..72ada21
*** a/src/test/regress/expected/copy2.out
--- b/src/test/regress/expected/copy2.out
*************** Check constraints:
*** 447,458 ****
copy check_con_tbl from stdin;
NOTICE: input = {"f1":1}
- CONTEXT: COPY check_con_tbl, line 1: "1"
NOTICE: input = {"f1":null}
- CONTEXT: COPY check_con_tbl, line 2: "\N"
copy check_con_tbl from stdin;
NOTICE: input = {"f1":0}
- CONTEXT: COPY check_con_tbl, line 1: "0"
ERROR: new row for relation "check_con_tbl" violates check constraint "check_con_tbl_check"
DETAIL: Failing row contains (0).
CONTEXT: COPY check_con_tbl, line 1: "0"
--- 447,455 ----
diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
new file mode 100644
index e70c315..05ac0ad
*** a/src/test/regress/expected/event_trigger.out
--- b/src/test/regress/expected/event_trigger.out
*************** drop cascades to table schema_one.table_
*** 234,248 ****
drop cascades to table schema_one."table two"
drop cascades to table schema_one.table_three
NOTICE: table "schema_two_table_two" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_two"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "audit_tbls_schema_two_table_three" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.audit_tbls_schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
- SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
ERROR: object audit_tbls.schema_two_table_three of type table cannot be dropped
! CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
--- 234,243 ----
drop cascades to table schema_one."table two"
drop cascades to table schema_one.table_three
NOTICE: table "schema_two_table_two" does not exist, skipping
NOTICE: table "audit_tbls_schema_two_table_three" does not exist, skipping
ERROR: object audit_tbls.schema_two_table_three of type table cannot be dropped
! CONTEXT: PL/pgSQL function undroppable() line 14 at RAISE
! SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
*************** drop cascades to table schema_one.table_
*** 255,277 ****
drop cascades to table schema_one."table two"
drop cascades to table schema_one.table_three
NOTICE: table "schema_two_table_two" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_two"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "audit_tbls_schema_two_table_three" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.audit_tbls_schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
- SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table_one" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_one_table_one"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table two" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls."schema_one_table two""
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table_three" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_one_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
ERROR: object schema_one.table_three of type table cannot be dropped
DELETE FROM undroppable_objs WHERE object_identity = 'schema_one.table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
NOTICE: drop cascades to 7 other objects
--- 250,261 ----
drop cascades to table schema_one."table two"
drop cascades to table schema_one.table_three
NOTICE: table "schema_two_table_two" does not exist, skipping
NOTICE: table "audit_tbls_schema_two_table_three" does not exist, skipping
NOTICE: table "schema_one_table_one" does not exist, skipping
NOTICE: table "schema_one_table two" does not exist, skipping
NOTICE: table "schema_one_table_three" does not exist, skipping
ERROR: object schema_one.table_three of type table cannot be dropped
+ CONTEXT: PL/pgSQL function undroppable() line 14 at RAISE
DELETE FROM undroppable_objs WHERE object_identity = 'schema_one.table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
NOTICE: drop cascades to 7 other objects
*************** drop cascades to table schema_one.table_
*** 283,304 ****
drop cascades to table schema_one."table two"
drop cascades to table schema_one.table_three
NOTICE: table "schema_two_table_two" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_two"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "audit_tbls_schema_two_table_three" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.audit_tbls_schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
- SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table_one" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_one_table_one"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table two" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls."schema_one_table two""
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
NOTICE: table "schema_one_table_three" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_one_table_three"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
SELECT * FROM dropped_objects WHERE schema IS NULL OR schema <> 'pg_toast';
type | schema | object
--------------+------------+-------------------------------------
--- 267,276 ----
*************** SELECT * FROM dropped_objects WHERE sche
*** 329,336 ****
DROP OWNED BY regression_bob;
NOTICE: schema "audit_tbls" does not exist, skipping
- CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.audit_tbls_schema_one_table_two"
- PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
SELECT * FROM dropped_objects WHERE type = 'schema';
type | schema | object
--------+--------+------------
--- 301,306 ----
*************** insert into rewriteme
*** 402,409 ****
--- 372,381 ----
select x * 1.001 from generate_series(1, 500) as t(x);
alter table rewriteme alter column foo type numeric;
ERROR: I'm sorry Sir, No Rewrite Allowed.
+ CONTEXT: PL/pgSQL function test_evtrig_no_rewrite() line 3 at RAISE
alter table rewriteme add column baz int default 0;
ERROR: I'm sorry Sir, No Rewrite Allowed.
+ CONTEXT: PL/pgSQL function test_evtrig_no_rewrite() line 3 at RAISE
-- test with more than one reason to rewrite a single table
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
diff --git a/src/test/regress/expected/plancache.out b/src/test/regress/expected/plancache.out
new file mode 100644
index 864f70f..3f3db33
*** a/src/test/regress/expected/plancache.out
--- b/src/test/regress/expected/plancache.out
*************** begin
*** 234,241 ****
end$$ language plpgsql;
select cachebug();
NOTICE: table "temptable" does not exist, skipping
- CONTEXT: SQL statement "drop table if exists temptable cascade"
- PL/pgSQL function cachebug() line 4 at SQL statement
NOTICE: 1
NOTICE: 2
NOTICE: 3
--- 234,239 ----
*************** NOTICE: 3
*** 246,253 ****
select cachebug();
NOTICE: drop cascades to view vv
- CONTEXT: SQL statement "drop table if exists temptable cascade"
- PL/pgSQL function cachebug() line 4 at SQL statement
NOTICE: 1
NOTICE: 2
NOTICE: 3
--- 244,249 ----
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out
new file mode 100644
index 7ce5415..a19424d
*** a/src/test/regress/expected/plpgsql.out
--- b/src/test/regress/expected/plpgsql.out
*************** ERROR: duplicate key value violates uni
*** 1518,1544 ****
DETAIL: Key (name)=(PF1_1) already exists.
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal backlink beginning with XX
! CONTEXT: PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
ERROR: PS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_slotlink_a() line 17 at assignment
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
! CONTEXT: PL/pgSQL function tg_slotlink_a() line 17 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key value violates unique constraint "hslot_name"
DETAIL: Key (slotname)=(HS.base.hub1.1 ) already exists.
insert into HSlot values ('HS', 'base.hub1', 20, '');
ERROR: no manual manipulation of HSlot
delete from HSlot;
ERROR: no manual manipulation of HSlot
insert into IFace values ('IF', 'notthere', 'eth0', '');
ERROR: system "notthere" does not exist
insert into IFace values ('IF', 'orion', 'ethernet_interface_name_too_long', '');
ERROR: IFace slotname "IF.orion.ethernet_interface_name_too_long" too long (20 char max)
--
-- The following tests are unrelated to the scenario outlined above;
-- they merely exercise specific parts of PL/pgSQL
--- 1518,1552 ----
DETAIL: Key (name)=(PF1_1) already exists.
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_backlink_set(character,character) line 30 at RAISE
! PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal backlink beginning with XX
! CONTEXT: PL/pgSQL function tg_backlink_set(character,character) line 47 at RAISE
! PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
ERROR: PS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_slotlink_set(character,character) line 30 at RAISE
! PL/pgSQL function tg_slotlink_a() line 17 at assignment
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
! CONTEXT: PL/pgSQL function tg_slotlink_set(character,character) line 77 at RAISE
! PL/pgSQL function tg_slotlink_a() line 17 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key value violates unique constraint "hslot_name"
DETAIL: Key (slotname)=(HS.base.hub1.1 ) already exists.
insert into HSlot values ('HS', 'base.hub1', 20, '');
ERROR: no manual manipulation of HSlot
+ CONTEXT: PL/pgSQL function tg_hslot_biu() line 12 at RAISE
delete from HSlot;
ERROR: no manual manipulation of HSlot
+ CONTEXT: PL/pgSQL function tg_hslot_bd() line 12 at RAISE
insert into IFace values ('IF', 'notthere', 'eth0', '');
ERROR: system "notthere" does not exist
+ CONTEXT: PL/pgSQL function tg_iface_biu() line 8 at RAISE
insert into IFace values ('IF', 'orion', 'ethernet_interface_name_too_long', '');
ERROR: IFace slotname "IF.orion.ethernet_interface_name_too_long" too long (20 char max)
+ CONTEXT: PL/pgSQL function tg_iface_biu() line 14 at RAISE
--
-- The following tests are unrelated to the scenario outlined above;
-- they merely exercise specific parts of PL/pgSQL
*************** NOTICE: should see this
*** 1963,1968 ****
--- 1971,1977 ----
NOTICE: should see this only if -100 <> 0
NOTICE: should see this only if -100 fits in smallint
ERROR: -100 is less than zero
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 12 at RAISE
create function trap_matching_test(int) returns int as $$
declare x int;
sx smallint;
*************** begin
*** 2066,2079 ****
end$$ language plpgsql;
select test_variable_storage();
NOTICE: should see this
- CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
- PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 <> 0
- CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
- PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 fits in smallint
- CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
- PL/pgSQL function test_variable_storage() line 8 at PERFORM
test_variable_storage
-----------------------
123456789012
--- 2075,2082 ----
*************** DETAIL: some detail info
*** 4052,4057 ****
--- 4055,4061 ----
HINT: some hint
ERROR: 1 2 3
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 5 at RAISE
-- Since we can't actually see the thrown SQLSTATE in default psql output,
-- test it like this; this also tests re-RAISE
create or replace function raise_test() returns void as $$
*************** select raise_test();
*** 4068,4073 ****
--- 4072,4078 ----
NOTICE: SQLSTATE: 22012 SQLERRM: check me
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise 'check me'
*************** select raise_test();
*** 4082,4087 ****
--- 4087,4093 ----
NOTICE: SQLSTATE: 1234F SQLERRM: check me
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
-- SQLSTATE specification in WHEN
create or replace function raise_test() returns void as $$
begin
*************** select raise_test();
*** 4097,4102 ****
--- 4103,4109 ----
NOTICE: SQLSTATE: 1234F SQLERRM: check me
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero using detail = 'some detail info';
*************** select raise_test();
*** 4110,4115 ****
--- 4117,4123 ----
NOTICE: SQLSTATE: 22012 SQLERRM: division_by_zero
ERROR: division_by_zero
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero;
*************** end;
*** 4117,4122 ****
--- 4125,4131 ----
$$ language plpgsql;
select raise_test();
ERROR: division_by_zero
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise sqlstate '1234F';
*************** end;
*** 4124,4129 ****
--- 4133,4139 ----
$$ language plpgsql;
select raise_test();
ERROR: 1234F
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero using message = 'custom' || ' message';
*************** end;
*** 4131,4136 ****
--- 4141,4147 ----
$$ language plpgsql;
select raise_test();
ERROR: custom message
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise using message = 'custom' || ' message', errcode = '22012';
*************** end;
*** 4138,4143 ****
--- 4149,4155 ----
$$ language plpgsql;
select raise_test();
ERROR: custom message
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
-- conflict on message
create or replace function raise_test() returns void as $$
begin
*************** $$ language plpgsql;
*** 4254,4259 ****
--- 4266,4272 ----
select raise_test();
NOTICE: 22012
ERROR: substitute message
+ CONTEXT: PL/pgSQL function raise_test() line 7 at RAISE
drop function raise_test();
-- test passing column_name, constraint_name, datatype_name, table_name
-- and schema_name error fields
*************** LINE 1: SELECT 'foo\\bar\041baz'
*** 4744,4750 ****
^
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
QUERY: SELECT 'foo\\bar\041baz'
- CONTEXT: PL/pgSQL function strtest() line 4 at RETURN
strtest
-------------
foo\bar!baz
--- 4757,4762 ----
*************** $$ language plpgsql;
*** 5260,5281 ****
select outer_outer_func(10);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
--- 5272,5285 ----
*************** NOTICE: outer_func() done
*** 5286,5307 ****
select outer_outer_func(20);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
--- 5290,5303 ----
*************** $$ language plpgsql;
*** 5358,5379 ****
select outer_outer_func(10);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
--- 5354,5367 ----
*************** NOTICE: outer_func() done
*** 5384,5405 ****
select outer_outer_func(20);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
- CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
- PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
- CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
--- 5372,5385 ----
diff --git a/src/test/regress/expected/privileges.out b/src/test/regress/expected/privileges.out
new file mode 100644
index c0cd9fa..88bdc2c
*** a/src/test/regress/expected/privileges.out
--- b/src/test/regress/expected/privileges.out
*************** GRANT regressgroup2 TO regressuser5; --
*** 1023,1029 ****
ERROR: must have admin option on role "regressgroup2"
SELECT dogrant_ok(); -- ok: SECURITY DEFINER conveys ADMIN
NOTICE: role "regressuser5" is already a member of role "regressgroup2"
- CONTEXT: SQL function "dogrant_ok" statement 1
dogrant_ok
------------
--- 1023,1028 ----
diff --git a/src/test/regress/expected/rangefuncs.out b/src/test/regress/expected/rangefuncs.out
new file mode 100644
index 6dabe50..00ef421
*** a/src/test/regress/expected/rangefuncs.out
--- b/src/test/regress/expected/rangefuncs.out
*************** create trigger tnoticetrigger after inse
*** 1704,1712 ****
execute procedure noticetrigger();
select insert_tt2('foolme','barme') limit 1;
NOTICE: noticetrigger 11 foolme
- CONTEXT: SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 12 barme
- CONTEXT: SQL function "insert_tt2" statement 1
insert_tt2
------------
11
--- 1704,1710 ----
*************** create rule insert_tt_rule as on insert
*** 1735,1743 ****
insert into tt_log values(new.*);
select insert_tt2('foollog','barlog') limit 1;
NOTICE: noticetrigger 13 foollog
- CONTEXT: SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 14 barlog
- CONTEXT: SQL function "insert_tt2" statement 1
insert_tt2
------------
13
--- 1733,1739 ----
diff --git a/src/test/regress/expected/triggers.out b/src/test/regress/expected/triggers.out
new file mode 100644
index 3b32e8f..cd43e46
*** a/src/test/regress/expected/triggers.out
--- b/src/test/regress/expected/triggers.out
*************** NOTICE: main_view BEFORE INSERT STATEME
*** 958,968 ****
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
NOTICE: NEW: (20,30)
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
- PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
- PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
INSERT 0 1
INSERT INTO main_view VALUES (21, 31) RETURNING a, b;
--- 958,964 ----
*************** NOTICE: main_view BEFORE INSERT STATEME
*** 970,980 ****
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
NOTICE: NEW: (21,31)
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
- PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
- PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
a | b
----+----
--- 966,972 ----
*************** NOTICE: main_view BEFORE UPDATE STATEME
*** 988,1004 ****
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (20,30), NEW: (20,31)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
UPDATE 0
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
--- 980,988 ----
*************** NOTICE: main_view BEFORE UPDATE STATEME
*** 1006,1022 ****
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (21,31), NEW: (21,32)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
a | b
---+---
--- 990,998 ----
*************** NOTICE: main_view BEFORE UPDATE STATEME
*** 1031,1050 ****
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (20,30), NEW: (20,31)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
UPDATE 1
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
--- 1007,1016 ----
*************** NOTICE: main_view BEFORE UPDATE STATEME
*** 1052,1071 ****
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (21,31), NEW: (21,32)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
- CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
- PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
a | b
----+----
--- 1018,1027 ----
*************** INSERT 0 1
*** 1277,1282 ****
--- 1233,1239 ----
-- UPDATE .. RETURNING
UPDATE city_view SET country_name = 'Japon' WHERE city_name = 'Tokyo'; -- error
ERROR: No such country: "Japon"
+ CONTEXT: PL/pgSQL function city_update() line 9 at RAISE
UPDATE city_view SET country_name = 'Japan' WHERE city_name = 'Takyo'; -- no match
UPDATE 0
UPDATE city_view SET country_name = 'Japan' WHERE city_name = 'Tokyo' RETURNING *; -- OK
*************** select pg_trigger_depth();
*** 1489,1514 ****
insert into depth_a values (1);
NOTICE: depth_a_tr: depth = 1
NOTICE: depth_b_tr: depth = 2
- CONTEXT: SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
- CONTEXT: SQL statement "insert into depth_c values (1)"
- PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
- SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: SQLSTATE = U9999: depth = 2
- CONTEXT: SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
- CONTEXT: SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
- CONTEXT: SQL statement "insert into depth_c values (1)"
- PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
- SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
ERROR: U9999
! CONTEXT: SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
--- 1446,1458 ----
insert into depth_a values (1);
NOTICE: depth_a_tr: depth = 1
NOTICE: depth_b_tr: depth = 2
NOTICE: depth_c_tr: depth = 3
NOTICE: SQLSTATE = U9999: depth = 2
NOTICE: depth_b_tr: depth = 2
NOTICE: depth_c_tr: depth = 3
ERROR: U9999
! CONTEXT: PL/pgSQL function depth_c_tf() line 5 at RAISE
! SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
*************** select pg_trigger_depth();
*** 1521,1541 ****
insert into depth_a values (2);
NOTICE: depth_a_tr: depth = 1
NOTICE: depth_b_tr: depth = 2
- CONTEXT: SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
- CONTEXT: SQL statement "insert into depth_c values (2)"
- PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
- SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
- CONTEXT: SQL statement "insert into depth_c values (2)"
- PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
- SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
- CONTEXT: SQL statement "insert into depth_b values (new.id)"
- PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_a_tr: depth = 1
select pg_trigger_depth();
pg_trigger_depth
--- 1465,1473 ----
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out
new file mode 100644
index 9b2d264..5691e47
*** a/src/test/regress/expected/xml.out
--- b/src/test/regress/expected/xml.out
*************** SELECT xpath('/*', '<relativens xmlns=''
*** 934,940 ****
WARNING: line 1: xmlns: URI relative is not absolute
<relativens xmlns='relative'/>
^
- CONTEXT: SQL function "xpath" statement 1
xpath
--------------------------------------
{"<relativens xmlns=\"relative\"/>"}
--- 934,939 ----
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers