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/expected/plpython_test.out | |
| 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/expected/plpython_test.out')
| -rw-r--r-- | src/pl/plpython/expected/plpython_test.out | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_test.out b/src/pl/plpython/expected/plpython_test.out index a229b18f44..3293829572 100644 --- a/src/pl/plpython/expected/plpython_test.out +++ b/src/pl/plpython/expected/plpython_test.out @@ -35,6 +35,19 @@ select argument_test_one(users, fname, lname) from users where lname = 'doe' ord willem doe => {fname: willem, lname: doe, userid: 3, username: w_doe} (3 rows) +-- 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(); + module_contents +------------------------------------------------------------------------------------------- + Error, Fatal, SPIError, debug, error, execute, fatal, info, log, notice, prepare, warning +(1 row) + CREATE FUNCTION elog_test() RETURNS void AS $$ plpy.debug('debug') |
