1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Rearrange the handling of error context reports.

Remove the code in plpgsql that suppressed the innermost line of CONTEXT
for messages emitted by RAISE commands.  That was never more than a quick
backwards-compatibility hack, and it's pretty silly in cases where the
RAISE is nested in several levels of function.  What's more, it violated
our design theory that verbosity of error reports should be controlled
on the client side not the server side.

To alleviate the resulting noise increase, introduce a feature in libpq
and psql whereby the CONTEXT field of messages can be suppressed, either
always or only for non-error messages.  Printing CONTEXT for errors only
is now their default behavior.

The actual code changes here are pretty small, but the effects on the
regression test outputs are widespread.  I had to edit some of the
alternative expected outputs by hand; hopefully the buildfarm will soon
find anything I fat-fingered.

In passing, fix up (again) the output line counts in psql's various
help displays.  Add some commentary about how to verify them.

Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others
This commit is contained in:
Tom Lane
2015-09-05 11:58:20 -04:00
parent c80b5f66c6
commit 0426f349ef
48 changed files with 237 additions and 610 deletions

View File

@@ -614,7 +614,6 @@ DO $$
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.
@@ -628,7 +627,6 @@ CONTEXT: PL/Perl anonymous code block
-- 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;

View File

@@ -7,7 +7,6 @@ create or replace function perl_elog(text) returns void language plperl as $$
$$;
select perl_elog('explicit elog');
NOTICE: explicit elog
CONTEXT: PL/Perl function "perl_elog"
perl_elog
-----------
@@ -21,7 +20,6 @@ create or replace function perl_warn(text) returns void language plperl as $$
$$;
select perl_warn('implicit elog via warn');
WARNING: implicit elog via warn at line 4.
CONTEXT: PL/Perl function "perl_warn"
perl_warn
-----------
@@ -61,7 +59,6 @@ select uses_global();
-- 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";
@@ -94,11 +91,7 @@ return $a + $b;
$$;
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

View File

@@ -7,7 +7,6 @@ create or replace function perl_elog(text) returns void language plperl as $$
$$;
select perl_elog('explicit elog');
NOTICE: explicit elog
CONTEXT: PL/Perl function "perl_elog"
perl_elog
-----------
@@ -21,7 +20,6 @@ create or replace function perl_warn(text) returns void language plperl as $$
$$;
select perl_warn('implicit elog via warn');
WARNING: implicit elog via warn at line 4.
CONTEXT: PL/Perl function "perl_warn"
perl_warn
-----------
@@ -61,7 +59,6 @@ select uses_global();
-- 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";
@@ -94,11 +91,7 @@ return $a + $b;
$$;
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

View File

@@ -62,75 +62,41 @@ BEFORE INSERT OR UPDATE OR DELETE ON trigger_test
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;
@@ -139,75 +105,41 @@ INSTEAD OF INSERT OR UPDATE OR DELETE ON trigger_test_view
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();
@@ -319,28 +251,18 @@ create event trigger perl_b_snitch on ddl_command_end
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;

View File

@@ -6,7 +6,6 @@ LOAD 'plperl';
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.

View File

@@ -42,8 +42,6 @@
#include "utils/typcache.h"
static const char *const raise_skip_msg = "RAISE";
typedef struct
{
int nargs; /* number of arguments */
@@ -933,10 +931,6 @@ plpgsql_exec_error_callback(void *arg)
{
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)
{
/*
@@ -3152,8 +3146,6 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
/*
* 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),
@@ -3170,8 +3162,6 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
(err_schema != NULL) ?
err_generic_string(PG_DIAG_SCHEMA_NAME, err_schema) : 0));
estate->err_text = NULL; /* un-suppress... */
if (condname != NULL)
pfree(condname);
if (err_message != NULL)

View File

@@ -1,9 +1,7 @@
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):

View File

@@ -108,7 +108,6 @@ return None
LANGUAGE plpythonu;
SELECT invalid_type_caught('rick');
NOTICE: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_caught"
invalid_type_caught
---------------------
@@ -232,7 +231,6 @@ return "you''ve been warned"
LANGUAGE plpythonu;
SELECT nested_warning();
WARNING: boom
CONTEXT: PL/Python function "nested_warning"
nested_warning
--------------------
you've been warned
@@ -336,7 +334,6 @@ SELECT specific_exception(2);
SELECT specific_exception(NULL);
NOTICE: Violated the NOT NULL constraint, sqlstate 23502
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------
@@ -344,7 +341,6 @@ CONTEXT: PL/Python function "specific_exception"
SELECT specific_exception(2);
NOTICE: Violated the UNIQUE constraint, sqlstate 23505
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------

View File

@@ -108,7 +108,6 @@ return None
LANGUAGE plpythonu;
SELECT invalid_type_caught('rick');
NOTICE: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_caught"
invalid_type_caught
---------------------
@@ -232,7 +231,6 @@ return "you''ve been warned"
LANGUAGE plpythonu;
SELECT nested_warning();
WARNING: boom
CONTEXT: PL/Python function "nested_warning"
nested_warning
--------------------
you've been warned
@@ -336,7 +334,6 @@ SELECT specific_exception(2);
SELECT specific_exception(NULL);
NOTICE: Violated the NOT NULL constraint, sqlstate 23502
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------
@@ -344,7 +341,6 @@ CONTEXT: PL/Python function "specific_exception"
SELECT specific_exception(2);
NOTICE: Violated the UNIQUE constraint, sqlstate 23505
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------

View File

@@ -108,7 +108,6 @@ return None
LANGUAGE plpython3u;
SELECT invalid_type_caught('rick');
NOTICE: type "test" does not exist
CONTEXT: PL/Python function "invalid_type_caught"
invalid_type_caught
---------------------
@@ -232,7 +231,6 @@ return "you''ve been warned"
LANGUAGE plpython3u;
SELECT nested_warning();
WARNING: boom
CONTEXT: PL/Python function "nested_warning"
nested_warning
--------------------
you've been warned
@@ -336,7 +334,6 @@ SELECT specific_exception(2);
SELECT specific_exception(NULL);
NOTICE: Violated the NOT NULL constraint, sqlstate 23502
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------
@@ -344,7 +341,6 @@ CONTEXT: PL/Python function "specific_exception"
SELECT specific_exception(2);
NOTICE: Violated the UNIQUE constraint, sqlstate 23505
CONTEXT: PL/Python function "specific_exception"
specific_exception
--------------------

View File

@@ -130,13 +130,9 @@ else:
$$ 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
@@ -144,7 +140,6 @@ CONTEXT: PL/Python function "result_metadata_test"
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>
@@ -234,15 +229,10 @@ else:
$$ 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
-----------------------
@@ -257,7 +247,6 @@ plpy.info(result[:])
$$ LANGUAGE plpythonu;
SELECT result_empty_test();
INFO: []
CONTEXT: PL/Python function "result_empty_test"
result_empty_test
-------------------

View File

@@ -154,7 +154,6 @@ SELECT * FROM subtransaction_tbl;
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
@@ -180,9 +179,6 @@ return "ok"
$$ 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
@@ -251,7 +247,6 @@ CONTEXT: Traceback (most recent call last):
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
-----------------------------------
@@ -259,7 +254,6 @@ CONTEXT: PL/Python function "subtransaction_enter_without_exit"
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>
@@ -267,9 +261,7 @@ CONTEXT: Traceback (most recent call last):
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
----------------------------
@@ -283,7 +275,6 @@ CONTEXT: Traceback (most recent call last):
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>
@@ -329,9 +320,7 @@ except plpy.SPIError:
$$ 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
------------------------------------------
@@ -370,7 +359,6 @@ with plpy.subtransaction():
$$ LANGUAGE plpythonu;
SELECT try_catch_inside_subtransaction();
NOTICE: caught
CONTEXT: PL/Python function "try_catch_inside_subtransaction"
try_catch_inside_subtransaction
---------------------------------
@@ -395,7 +383,6 @@ with plpy.subtransaction():
$$ LANGUAGE plpythonu;
SELECT pk_violation_inside_subtransaction();
NOTICE: caught
CONTEXT: PL/Python function "pk_violation_inside_subtransaction"
pk_violation_inside_subtransaction
------------------------------------

View File

@@ -235,7 +235,6 @@ CONTEXT: Traceback (most recent call last):
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
-----------------------------------
@@ -243,7 +242,6 @@ CONTEXT: PL/Python function "subtransaction_enter_without_exit"
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>
@@ -251,9 +249,7 @@ CONTEXT: Traceback (most recent call last):
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
----------------------------
@@ -267,7 +263,6 @@ CONTEXT: Traceback (most recent call last):
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>

View File

@@ -235,7 +235,6 @@ CONTEXT: Traceback (most recent call last):
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
-----------------------------------
@@ -243,7 +242,6 @@ CONTEXT: PL/Python function "subtransaction_enter_without_exit"
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>
@@ -251,9 +249,7 @@ CONTEXT: Traceback (most recent call last):
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
----------------------------
@@ -267,7 +263,6 @@ CONTEXT: Traceback (most recent call last):
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>

View File

@@ -62,17 +62,11 @@ plpy.error('error')
$$ 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>

View File

@@ -98,208 +98,108 @@ BEFORE INSERT OR UPDATE OR DELETE OR TRUNCATE ON trigger_test
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;
@@ -310,67 +210,37 @@ INSTEAD OF INSERT OR UPDATE OR DELETE ON trigger_test_view
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;
@@ -402,7 +272,6 @@ BEFORE DELETE ON trigger_test
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

View File

@@ -10,7 +10,6 @@ return x
$$ 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
@@ -18,7 +17,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool"
SELECT * FROM test_type_conversion_bool(false);
INFO: (False, <type 'bool'>)
CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
f
@@ -26,7 +24,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool"
SELECT * FROM test_type_conversion_bool(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
@@ -54,7 +51,6 @@ return ret
$$ 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
@@ -62,7 +58,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -70,7 +65,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -78,7 +72,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -86,7 +79,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -94,7 +86,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -106,7 +97,6 @@ return x
$$ 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
@@ -114,7 +104,6 @@ CONTEXT: PL/Python function "test_type_conversion_char"
SELECT * FROM test_type_conversion_char(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_char"
test_type_conversion_char
---------------------------
@@ -126,7 +115,6 @@ return x
$$ 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
@@ -134,7 +122,6 @@ CONTEXT: PL/Python function "test_type_conversion_int2"
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
@@ -142,7 +129,6 @@ CONTEXT: PL/Python function "test_type_conversion_int2"
SELECT * FROM test_type_conversion_int2(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
@@ -154,7 +140,6 @@ return x
$$ 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
@@ -162,7 +147,6 @@ CONTEXT: PL/Python function "test_type_conversion_int4"
SELECT * FROM test_type_conversion_int4(-100);
INFO: (-100, <type 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
-100
@@ -170,7 +154,6 @@ CONTEXT: PL/Python function "test_type_conversion_int4"
SELECT * FROM test_type_conversion_int4(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
@@ -182,7 +165,6 @@ return x
$$ 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
@@ -190,7 +172,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(-100);
INFO: (-100L, <type 'long'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
-100
@@ -198,7 +179,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(5000000000);
INFO: (5000000000L, <type 'long'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
5000000000
@@ -206,7 +186,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
@@ -220,7 +199,6 @@ return x
$$ 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
@@ -228,7 +206,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
SELECT * FROM test_type_conversion_numeric(-100);
INFO: ('-100', 'Decimal')
CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
-100
@@ -236,7 +213,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -244,7 +220,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -252,7 +227,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -260,7 +234,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -268,7 +241,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -276,7 +248,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
SELECT * FROM test_type_conversion_numeric(null);
INFO: ('None', 'NoneType')
CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
@@ -288,7 +259,6 @@ return x
$$ 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
@@ -296,7 +266,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
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
@@ -304,7 +273,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
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
@@ -312,7 +280,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
SELECT * FROM test_type_conversion_float4(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
@@ -324,7 +291,6 @@ return x
$$ 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
@@ -332,7 +298,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
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
@@ -340,7 +305,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
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
@@ -348,7 +312,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
SELECT * FROM test_type_conversion_float8(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
@@ -356,7 +319,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
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
@@ -368,7 +330,6 @@ return x
$$ 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
@@ -376,7 +337,6 @@ CONTEXT: PL/Python function "test_type_conversion_oid"
SELECT * FROM test_type_conversion_oid(2147483649);
INFO: (2147483649L, <type 'long'>)
CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
2147483649
@@ -384,7 +344,6 @@ CONTEXT: PL/Python function "test_type_conversion_oid"
SELECT * FROM test_type_conversion_oid(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
@@ -396,7 +355,6 @@ return x
$$ 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
@@ -404,7 +362,6 @@ CONTEXT: PL/Python function "test_type_conversion_text"
SELECT * FROM test_type_conversion_text(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_text"
test_type_conversion_text
---------------------------
@@ -416,7 +373,6 @@ return x
$$ 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
@@ -424,7 +380,6 @@ CONTEXT: PL/Python function "test_type_conversion_bytea"
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
@@ -432,7 +387,6 @@ CONTEXT: PL/Python function "test_type_conversion_bytea"
SELECT * FROM test_type_conversion_bytea(null);
INFO: (None, <type 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
@@ -481,7 +435,6 @@ return y
$$ 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
@@ -489,13 +442,11 @@ CONTEXT: PL/Python function "test_type_conversion_uint2"
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
@@ -524,7 +475,6 @@ return y
$$ 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
@@ -534,7 +484,6 @@ SELECT * FROM test_type_conversion_bytea10('hello world', 'hello wold');
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"
@@ -542,7 +491,6 @@ SELECT * FROM test_type_conversion_bytea10(null, 'hello word');
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"
@@ -555,7 +503,6 @@ return x
$$ 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}
@@ -563,7 +510,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
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}
@@ -571,7 +517,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
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}
@@ -579,7 +524,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
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
---------------------------------
{}
@@ -587,7 +531,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
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
---------------------------------
@@ -603,7 +546,6 @@ return x
$$ 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}
@@ -615,7 +557,6 @@ return x
$$ 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}
@@ -681,7 +622,6 @@ return x
$$ 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}
@@ -689,7 +629,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_domain"
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
-----------------------------------
@@ -783,7 +722,6 @@ return rv[0]['val']
$$;
SELECT test_prep_bool_output(); -- false
INFO: {'val': False}
CONTEXT: PL/Python function "test_prep_bool_output"
test_prep_bool_output
-----------------------
f
@@ -812,7 +750,6 @@ return rv[0]['val']
$$;
SELECT test_prep_bytea_output();
INFO: {'val': '\xaa\x00\xbb'}
CONTEXT: PL/Python function "test_prep_bytea_output"
test_prep_bytea_output
------------------------
\xaa00bb

View File

@@ -10,7 +10,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_bool(true);
INFO: (True, <class 'bool'>)
CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
t
@@ -18,7 +17,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool"
SELECT * FROM test_type_conversion_bool(false);
INFO: (False, <class 'bool'>)
CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
f
@@ -26,7 +24,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool"
SELECT * FROM test_type_conversion_bool(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_bool"
test_type_conversion_bool
---------------------------
@@ -54,7 +51,6 @@ return ret
$$ LANGUAGE plpython3u;
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
@@ -62,7 +58,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -70,7 +65,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -78,7 +72,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -86,7 +79,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -94,7 +86,6 @@ CONTEXT: PL/Python function "test_type_conversion_bool_other"
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
@@ -106,7 +97,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_char('a');
INFO: ('a', <class 'str'>)
CONTEXT: PL/Python function "test_type_conversion_char"
test_type_conversion_char
---------------------------
a
@@ -114,7 +104,6 @@ CONTEXT: PL/Python function "test_type_conversion_char"
SELECT * FROM test_type_conversion_char(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_char"
test_type_conversion_char
---------------------------
@@ -126,7 +115,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_int2(100::int2);
INFO: (100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
100
@@ -134,7 +122,6 @@ CONTEXT: PL/Python function "test_type_conversion_int2"
SELECT * FROM test_type_conversion_int2(-100::int2);
INFO: (-100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
-100
@@ -142,7 +129,6 @@ CONTEXT: PL/Python function "test_type_conversion_int2"
SELECT * FROM test_type_conversion_int2(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int2"
test_type_conversion_int2
---------------------------
@@ -154,7 +140,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_int4(100);
INFO: (100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
100
@@ -162,7 +147,6 @@ CONTEXT: PL/Python function "test_type_conversion_int4"
SELECT * FROM test_type_conversion_int4(-100);
INFO: (-100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
-100
@@ -170,7 +154,6 @@ CONTEXT: PL/Python function "test_type_conversion_int4"
SELECT * FROM test_type_conversion_int4(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int4"
test_type_conversion_int4
---------------------------
@@ -182,7 +165,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_int8(100);
INFO: (100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
100
@@ -190,7 +172,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(-100);
INFO: (-100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
-100
@@ -198,7 +179,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(5000000000);
INFO: (5000000000, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
5000000000
@@ -206,7 +186,6 @@ CONTEXT: PL/Python function "test_type_conversion_int8"
SELECT * FROM test_type_conversion_int8(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_int8"
test_type_conversion_int8
---------------------------
@@ -220,7 +199,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_numeric(100);
INFO: ('100', 'Decimal')
CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
100
@@ -228,7 +206,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
SELECT * FROM test_type_conversion_numeric(-100);
INFO: ('-100', 'Decimal')
CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
-100
@@ -236,7 +213,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -244,7 +220,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -252,7 +227,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -260,7 +234,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -268,7 +241,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
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
@@ -276,7 +248,6 @@ CONTEXT: PL/Python function "test_type_conversion_numeric"
SELECT * FROM test_type_conversion_numeric(null);
INFO: ('None', 'NoneType')
CONTEXT: PL/Python function "test_type_conversion_numeric"
test_type_conversion_numeric
------------------------------
@@ -288,7 +259,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_float4(100);
INFO: (100.0, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
100
@@ -296,7 +266,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
SELECT * FROM test_type_conversion_float4(-100);
INFO: (-100.0, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
-100
@@ -304,7 +273,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
SELECT * FROM test_type_conversion_float4(5000.5);
INFO: (5000.5, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
5000.5
@@ -312,7 +280,6 @@ CONTEXT: PL/Python function "test_type_conversion_float4"
SELECT * FROM test_type_conversion_float4(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_float4"
test_type_conversion_float4
-----------------------------
@@ -324,7 +291,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_float8(100);
INFO: (100.0, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
100
@@ -332,7 +298,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
SELECT * FROM test_type_conversion_float8(-100);
INFO: (-100.0, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
-100
@@ -340,7 +305,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
SELECT * FROM test_type_conversion_float8(5000000000.5);
INFO: (5000000000.5, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
5000000000.5
@@ -348,7 +312,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
SELECT * FROM test_type_conversion_float8(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
@@ -356,7 +319,6 @@ CONTEXT: PL/Python function "test_type_conversion_float8"
SELECT * FROM test_type_conversion_float8(100100100.654321);
INFO: (100100100.654321, <class 'float'>)
CONTEXT: PL/Python function "test_type_conversion_float8"
test_type_conversion_float8
-----------------------------
100100100.654321
@@ -368,7 +330,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_oid(100);
INFO: (100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
100
@@ -376,7 +337,6 @@ CONTEXT: PL/Python function "test_type_conversion_oid"
SELECT * FROM test_type_conversion_oid(2147483649);
INFO: (2147483649, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
2147483649
@@ -384,7 +344,6 @@ CONTEXT: PL/Python function "test_type_conversion_oid"
SELECT * FROM test_type_conversion_oid(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_oid"
test_type_conversion_oid
--------------------------
@@ -396,7 +355,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_text('hello world');
INFO: ('hello world', <class 'str'>)
CONTEXT: PL/Python function "test_type_conversion_text"
test_type_conversion_text
---------------------------
hello world
@@ -404,7 +362,6 @@ CONTEXT: PL/Python function "test_type_conversion_text"
SELECT * FROM test_type_conversion_text(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_text"
test_type_conversion_text
---------------------------
@@ -416,7 +373,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_bytea('hello world');
INFO: (b'hello world', <class 'bytes'>)
CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
\x68656c6c6f20776f726c64
@@ -424,7 +380,6 @@ CONTEXT: PL/Python function "test_type_conversion_bytea"
SELECT * FROM test_type_conversion_bytea(E'null\\000byte');
INFO: (b'null\x00byte', <class 'bytes'>)
CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
\x6e756c6c0062797465
@@ -432,7 +387,6 @@ CONTEXT: PL/Python function "test_type_conversion_bytea"
SELECT * FROM test_type_conversion_bytea(null);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_bytea"
test_type_conversion_bytea
----------------------------
@@ -481,7 +435,6 @@ return y
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_uint2(100::uint2, 50);
INFO: (100, <class 'int'>)
CONTEXT: PL/Python function "test_type_conversion_uint2"
test_type_conversion_uint2
----------------------------
50
@@ -489,13 +442,11 @@ CONTEXT: PL/Python function "test_type_conversion_uint2"
SELECT * FROM test_type_conversion_uint2(100::uint2, -50);
INFO: (100, <class '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, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_uint2"
test_type_conversion_uint2
----------------------------
1
@@ -524,7 +475,6 @@ return y
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_bytea10('hello wold', 'hello wold');
INFO: (b'hello wold', <class 'bytes'>)
CONTEXT: PL/Python function "test_type_conversion_bytea10"
test_type_conversion_bytea10
------------------------------
\x68656c6c6f20776f6c64
@@ -534,7 +484,6 @@ SELECT * FROM test_type_conversion_bytea10('hello world', 'hello wold');
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
SELECT * FROM test_type_conversion_bytea10('hello word', 'hello world');
INFO: (b'hello word', <class 'bytes'>)
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"
@@ -542,7 +491,6 @@ SELECT * FROM test_type_conversion_bytea10(null, 'hello word');
ERROR: value for domain bytea10 violates check constraint "bytea10_check"
SELECT * FROM test_type_conversion_bytea10('hello word', null);
INFO: (b'hello word', <class 'bytes'>)
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"
@@ -555,7 +503,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_array_int4(ARRAY[0, 100]);
INFO: ([0, 100], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{0,100}
@@ -563,7 +510,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
SELECT * FROM test_type_conversion_array_int4(ARRAY[0,-100,55]);
INFO: ([0, -100, 55], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{0,-100,55}
@@ -571,7 +517,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
SELECT * FROM test_type_conversion_array_int4(ARRAY[NULL,1]);
INFO: ([None, 1], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{NULL,1}
@@ -579,7 +524,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
SELECT * FROM test_type_conversion_array_int4(ARRAY[]::integer[]);
INFO: ([], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
{}
@@ -587,7 +531,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_int4"
SELECT * FROM test_type_conversion_array_int4(NULL);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_array_int4"
test_type_conversion_array_int4
---------------------------------
@@ -603,7 +546,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_array_text(ARRAY['foo', 'bar']);
INFO: (['foo', 'bar'], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_text"
test_type_conversion_array_text
---------------------------------
{foo,bar}
@@ -615,7 +557,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_array_bytea(ARRAY[E'\\xdeadbeef'::bytea, NULL]);
INFO: ([b'\xde\xad\xbe\xef', None], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_bytea"
test_type_conversion_array_bytea
----------------------------------
{"\\xdeadbeef",NULL}
@@ -681,7 +622,6 @@ return x
$$ LANGUAGE plpython3u;
SELECT * FROM test_type_conversion_array_domain(ARRAY[0, 100]::ordered_pair_domain);
INFO: ([0, 100], <class 'list'>)
CONTEXT: PL/Python function "test_type_conversion_array_domain"
test_type_conversion_array_domain
-----------------------------------
{0,100}
@@ -689,7 +629,6 @@ CONTEXT: PL/Python function "test_type_conversion_array_domain"
SELECT * FROM test_type_conversion_array_domain(NULL::ordered_pair_domain);
INFO: (None, <class 'NoneType'>)
CONTEXT: PL/Python function "test_type_conversion_array_domain"
test_type_conversion_array_domain
-----------------------------------
@@ -783,7 +722,6 @@ return rv[0]['val']
$$;
SELECT test_prep_bool_output(); -- false
INFO: {'val': False}
CONTEXT: PL/Python function "test_prep_bool_output"
test_prep_bool_output
-----------------------
f
@@ -812,7 +750,6 @@ return rv[0]['val']
$$;
SELECT test_prep_bytea_output();
INFO: {'val': b'\xaa\x00\xbb'}
CONTEXT: PL/Python function "test_prep_bytea_output"
test_prep_bytea_output
------------------------
\xaa00bb