mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-07 14:07:30 +08:00
Augment test coverage in PL/Python, especially for error conditions.
This commit is contained in:
@ -26,3 +26,27 @@ 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)
|
||||
|
||||
CREATE FUNCTION elog_test() RETURNS void
|
||||
AS $$
|
||||
plpy.debug('debug')
|
||||
plpy.log('log')
|
||||
plpy.info('info')
|
||||
plpy.info(37)
|
||||
plpy.info('info', 37, [1, 2, 3])
|
||||
plpy.notice('notice')
|
||||
plpy.warning('warning')
|
||||
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: ('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: ('error',)
|
||||
CONTEXT: PL/Python function "elog_test"
|
||||
|
||||
Reference in New Issue
Block a user