diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2011-01-21 23:46:56 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2011-01-21 23:46:56 +0200 |
| commit | 4609caf3645ae975724af1f7f57f831e516cf220 (patch) | |
| tree | bb6bceebcfa37c5b0d7308e4b9e757edca584525 /src/pl/plpython/sql/plpython_test.sql | |
| parent | d3b372e92d4efdd6f63da35996f04ff009c932b5 (diff) | |
| download | postgresql-4609caf3645ae975724af1f7f57f831e516cf220.tar.gz | |
Correctly add exceptions to the plpy module for Python 3
The way the exception types where added to the module was wrong for
Python 3. Exception classes were not actually available from plpy.
Fix that by factoring out code that is responsible for defining new
Python exceptions and make it work with Python 3. New regression test
makes sure the plpy module has the expected contents.
Jan Urbanśki, slightly revised by me
Diffstat (limited to 'src/pl/plpython/sql/plpython_test.sql')
| -rw-r--r-- | src/pl/plpython/sql/plpython_test.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pl/plpython/sql/plpython_test.sql b/src/pl/plpython/sql/plpython_test.sql index 7cae124d98..915189847a 100644 --- a/src/pl/plpython/sql/plpython_test.sql +++ b/src/pl/plpython/sql/plpython_test.sql @@ -26,6 +26,17 @@ return words' select argument_test_one(users, fname, lname) from users where lname = 'doe' order by 1; +-- check module contents +CREATE FUNCTION module_contents() RETURNS text AS +$$ +contents = list(filter(lambda x: not x.startswith("__"), dir(plpy))) +contents.sort() +return ", ".join(contents) +$$ LANGUAGE plpythonu; + +select module_contents(); + + CREATE FUNCTION elog_test() RETURNS void AS $$ plpy.debug('debug') |
