diff options
Diffstat (limited to 'src/pl/plpython/sql/plpython_error.sql')
-rw-r--r-- | src/pl/plpython/sql/plpython_error.sql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pl/plpython/sql/plpython_error.sql b/src/pl/plpython/sql/plpython_error.sql index d0df7e607d3..d712eb1078f 100644 --- a/src/pl/plpython/sql/plpython_error.sql +++ b/src/pl/plpython/sql/plpython_error.sql @@ -328,3 +328,19 @@ EXCEPTION WHEN SQLSTATE 'SILLY' THEN -- NOOP END $$ LANGUAGE plpgsql; + +/* test the context stack trace for nested execution levels + */ +CREATE FUNCTION notice_innerfunc() RETURNS int AS $$ +plpy.execute("DO LANGUAGE plpythonu $x$ plpy.notice('inside DO') $x$") +return 1 +$$ LANGUAGE plpythonu; + +CREATE FUNCTION notice_outerfunc() RETURNS int AS $$ +plpy.execute("SELECT notice_innerfunc()") +return 1 +$$ LANGUAGE plpythonu; + +\set SHOW_CONTEXT always + +SELECT notice_outerfunc(); |