aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2016-10-19 12:00:00 -0400
committerPeter Eisentraut <peter_e@gmx.net>2016-10-27 15:41:29 -0400
commit84d457edaf4b3a1e10fd9e100e8ca18c042ad30c (patch)
tree1cff913aa8f507d764aded26a7333765ae2f566a
parent4f714b2fd2a580d909607de889ac822956eb8299 (diff)
downloadpostgresql-84d457edaf4b3a1e10fd9e100e8ca18c042ad30c.tar.gz
postgresql-84d457edaf4b3a1e10fd9e100e8ca18c042ad30c.zip
Format PL/Python module contents test vertically
It makes it readable again and makes merges more manageable.
-rw-r--r--src/pl/plpython/expected/plpython_test.out29
-rw-r--r--src/pl/plpython/sql/plpython_test.sql4
2 files changed, 25 insertions, 8 deletions
diff --git a/src/pl/plpython/expected/plpython_test.out b/src/pl/plpython/expected/plpython_test.out
index adb82a89d60..847e4cc412e 100644
--- a/src/pl/plpython/expected/plpython_test.out
+++ b/src/pl/plpython/expected/plpython_test.out
@@ -36,17 +36,34 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
(3 rows)
-- check module contents
-CREATE FUNCTION module_contents() RETURNS text AS
+CREATE FUNCTION module_contents() RETURNS SETOF text AS
$$
contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
contents.sort()
-return ", ".join(contents)
+return contents
$$ LANGUAGE plpythonu;
select module_contents();
- module_contents
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Error, Fatal, SPIError, cursor, debug, error, execute, fatal, info, log, notice, prepare, quote_ident, quote_literal, quote_nullable, spiexceptions, subtransaction, warning
-(1 row)
+ module_contents
+-----------------
+ Error
+ Fatal
+ SPIError
+ cursor
+ debug
+ error
+ execute
+ fatal
+ info
+ log
+ notice
+ prepare
+ quote_ident
+ quote_literal
+ quote_nullable
+ spiexceptions
+ subtransaction
+ warning
+(18 rows)
CREATE FUNCTION elog_test_basic() RETURNS void
AS $$
diff --git a/src/pl/plpython/sql/plpython_test.sql b/src/pl/plpython/sql/plpython_test.sql
index fa3c465ef86..5f1be9c94a8 100644
--- a/src/pl/plpython/sql/plpython_test.sql
+++ b/src/pl/plpython/sql/plpython_test.sql
@@ -27,11 +27,11 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
-- check module contents
-CREATE FUNCTION module_contents() RETURNS text AS
+CREATE FUNCTION module_contents() RETURNS SETOF text AS
$$
contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
contents.sort()
-return ", ".join(contents)
+return contents
$$ LANGUAGE plpythonu;
select module_contents();