From d8678aba2ee5969e6d2351c5361d488fc51c975f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 18 Nov 2022 16:00:52 +0100 Subject: [PATCH] Make object_address test output easier to update The object_address test file turns to psql unaligned output for some tests to avoid huge diffs for changes. But this is useful also to the other large test in that file, so apply it there as well. This also makes verifying the null and whitespace behavior easier. --- src/test/regress/expected/object_address.out | 114 +++++++++---------- src/test/regress/sql/object_address.sql | 12 +- 2 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out index c09ff2e7c3d..25c174f2750 100644 --- a/src/test/regress/expected/object_address.out +++ b/src/test/regress/expected/object_address.out @@ -382,6 +382,11 @@ SELECT pg_get_object_address('subscription', '{one}', '{}'); ERROR: subscription "one" does not exist SELECT pg_get_object_address('subscription', '{one,two}', '{}'); ERROR: name list length must be exactly 1 +-- Make sure that NULL handling is correct. +\pset null 'NULL' +-- Temporarily disable fancy output, so as future additions never create +-- a large amount of diffs. +\a\t -- test successful cases WITH objects (type, name, args) AS (VALUES ('table', '{addr_nsp, gentable}'::text[], '{}'::text[]), @@ -450,60 +455,56 @@ FROM objects, pg_identify_object_as_address(classid, objid, objsubid) AS ioa (typ, nms, args), pg_get_object_address(typ, nms, ioa.args) AS addr2 ORDER BY addr1.classid, addr1.objid, addr1.objsubid; - type | schema | name | identity | roundtrip ----------------------------+------------+-------------------+----------------------------------------------------------------------+----------- - default acl | | | for role regress_addr_user in schema public on tables | t - default acl | | | for role regress_addr_user on tables | t - type | pg_catalog | _int4 | integer[] | t - type | addr_nsp | gencomptype | addr_nsp.gencomptype | t - type | addr_nsp | genenum | addr_nsp.genenum | t - type | addr_nsp | gendomain | addr_nsp.gendomain | t - function | pg_catalog | | pg_catalog.pg_identify_object(pg_catalog.oid,pg_catalog.oid,integer) | t - aggregate | addr_nsp | | addr_nsp.genaggr(integer) | t - procedure | addr_nsp | | addr_nsp.proc(integer) | t - sequence | addr_nsp | gentable_a_seq | addr_nsp.gentable_a_seq | t - table | addr_nsp | gentable | addr_nsp.gentable | t - table column | addr_nsp | gentable | addr_nsp.gentable.b | t - index | addr_nsp | gentable_pkey | addr_nsp.gentable_pkey | t - table | addr_nsp | parttable | addr_nsp.parttable | t - index | addr_nsp | parttable_pkey | addr_nsp.parttable_pkey | t - view | addr_nsp | genview | addr_nsp.genview | t - materialized view | addr_nsp | genmatview | addr_nsp.genmatview | t - foreign table | addr_nsp | genftable | addr_nsp.genftable | t - foreign table column | addr_nsp | genftable | addr_nsp.genftable.a | t - role | | regress_addr_user | regress_addr_user | t - server | | addr_fserv | addr_fserv | t - user mapping | | | regress_addr_user on server integer | t - foreign-data wrapper | | addr_fdw | addr_fdw | t - access method | | btree | btree | t - operator of access method | | | operator 1 (integer, integer) of pg_catalog.integer_ops USING btree | t - function of access method | | | function 2 (integer, integer) of pg_catalog.integer_ops USING btree | t - default value | | | for addr_nsp.gentable.b | t - cast | | | (bigint AS integer) | t - table constraint | addr_nsp | | a_chk on addr_nsp.gentable | t - domain constraint | addr_nsp | | domconstr on addr_nsp.gendomain | t - conversion | pg_catalog | koi8_r_to_mic | pg_catalog.koi8_r_to_mic | t - language | | plpgsql | plpgsql | t - schema | | addr_nsp | addr_nsp | t - operator class | pg_catalog | int4_ops | pg_catalog.int4_ops USING btree | t - operator | pg_catalog | | pg_catalog.+(integer,integer) | t - rule | | | "_RETURN" on addr_nsp.genview | t - trigger | | | t on addr_nsp.gentable | t - operator family | pg_catalog | integer_ops | pg_catalog.integer_ops USING btree | t - policy | | | genpol on addr_nsp.gentable | t - statistics object | addr_nsp | gentable_stat | addr_nsp.gentable_stat | t - collation | pg_catalog | "default" | pg_catalog."default" | t - transform | | | for integer on language sql | t - text search dictionary | addr_nsp | addr_ts_dict | addr_nsp.addr_ts_dict | t - text search parser | addr_nsp | addr_ts_prs | addr_nsp.addr_ts_prs | t - text search configuration | addr_nsp | addr_ts_conf | addr_nsp.addr_ts_conf | t - text search template | addr_nsp | addr_ts_temp | addr_nsp.addr_ts_temp | t - subscription | | regress_addr_sub | regress_addr_sub | t - publication | | addr_pub | addr_pub | t - publication relation | | | addr_nsp.gentable in publication addr_pub | t - publication namespace | | | addr_nsp in publication addr_pub_schema | t -(50 rows) - +default acl|NULL|NULL|for role regress_addr_user in schema public on tables|t +default acl|NULL|NULL|for role regress_addr_user on tables|t +type|pg_catalog|_int4|integer[]|t +type|addr_nsp|gencomptype|addr_nsp.gencomptype|t +type|addr_nsp|genenum|addr_nsp.genenum|t +type|addr_nsp|gendomain|addr_nsp.gendomain|t +function|pg_catalog|NULL|pg_catalog.pg_identify_object(pg_catalog.oid,pg_catalog.oid,integer)|t +aggregate|addr_nsp|NULL|addr_nsp.genaggr(integer)|t +procedure|addr_nsp|NULL|addr_nsp.proc(integer)|t +sequence|addr_nsp|gentable_a_seq|addr_nsp.gentable_a_seq|t +table|addr_nsp|gentable|addr_nsp.gentable|t +table column|addr_nsp|gentable|addr_nsp.gentable.b|t +index|addr_nsp|gentable_pkey|addr_nsp.gentable_pkey|t +table|addr_nsp|parttable|addr_nsp.parttable|t +index|addr_nsp|parttable_pkey|addr_nsp.parttable_pkey|t +view|addr_nsp|genview|addr_nsp.genview|t +materialized view|addr_nsp|genmatview|addr_nsp.genmatview|t +foreign table|addr_nsp|genftable|addr_nsp.genftable|t +foreign table column|addr_nsp|genftable|addr_nsp.genftable.a|t +role|NULL|regress_addr_user|regress_addr_user|t +server|NULL|addr_fserv|addr_fserv|t +user mapping|NULL|NULL|regress_addr_user on server integer|t +foreign-data wrapper|NULL|addr_fdw|addr_fdw|t +access method|NULL|btree|btree|t +operator of access method|NULL|NULL|operator 1 (integer, integer) of pg_catalog.integer_ops USING btree|t +function of access method|NULL|NULL|function 2 (integer, integer) of pg_catalog.integer_ops USING btree|t +default value|NULL|NULL|for addr_nsp.gentable.b|t +cast|NULL|NULL|(bigint AS integer)|t +table constraint|addr_nsp|NULL|a_chk on addr_nsp.gentable|t +domain constraint|addr_nsp|NULL|domconstr on addr_nsp.gendomain|t +conversion|pg_catalog|koi8_r_to_mic|pg_catalog.koi8_r_to_mic|t +language|NULL|plpgsql|plpgsql|t +schema|NULL|addr_nsp|addr_nsp|t +operator class|pg_catalog|int4_ops|pg_catalog.int4_ops USING btree|t +operator|pg_catalog|NULL|pg_catalog.+(integer,integer)|t +rule|NULL|NULL|"_RETURN" on addr_nsp.genview|t +trigger|NULL|NULL|t on addr_nsp.gentable|t +operator family|pg_catalog|integer_ops|pg_catalog.integer_ops USING btree|t +policy|NULL|NULL|genpol on addr_nsp.gentable|t +statistics object|addr_nsp|gentable_stat|addr_nsp.gentable_stat|t +collation|pg_catalog|"default"|pg_catalog."default"|t +transform|NULL|NULL|for integer on language sql|t +text search dictionary|addr_nsp|addr_ts_dict|addr_nsp.addr_ts_dict|t +text search parser|addr_nsp|addr_ts_prs|addr_nsp.addr_ts_prs|t +text search configuration|addr_nsp|addr_ts_conf|addr_nsp.addr_ts_conf|t +text search template|addr_nsp|addr_ts_temp|addr_nsp.addr_ts_temp|t +subscription|NULL|regress_addr_sub|regress_addr_sub|t +publication|NULL|addr_pub|addr_pub|t +publication relation|NULL|NULL|addr_nsp.gentable in publication addr_pub|t +publication namespace|NULL|NULL|addr_nsp in publication addr_pub_schema|t --- --- Cleanup resources --- @@ -537,11 +538,6 @@ DROP USER regress_addr_user; -- -- Checks for invalid objects -- --- Make sure that NULL handling is correct. -\pset null 'NULL' --- Temporarily disable fancy output, so as future additions never create --- a large amount of diffs. -\a\t -- Keep this list in the same order as getObjectIdentityParts() -- in objectaddress.c. WITH objects (classid, objid, objsubid) AS (VALUES diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql index 6e8d7fd63d6..1a6c61f49d5 100644 --- a/src/test/regress/sql/object_address.sql +++ b/src/test/regress/sql/object_address.sql @@ -145,6 +145,13 @@ SELECT pg_get_object_address('publication', '{one,two}', '{}'); SELECT pg_get_object_address('subscription', '{one}', '{}'); SELECT pg_get_object_address('subscription', '{one,two}', '{}'); +-- Make sure that NULL handling is correct. +\pset null 'NULL' + +-- Temporarily disable fancy output, so as future additions never create +-- a large amount of diffs. +\a\t + -- test successful cases WITH objects (type, name, args) AS (VALUES ('table', '{addr_nsp, gentable}'::text[], '{}'::text[]), @@ -230,11 +237,6 @@ DROP USER regress_addr_user; -- -- Checks for invalid objects -- --- Make sure that NULL handling is correct. -\pset null 'NULL' --- Temporarily disable fancy output, so as future additions never create --- a large amount of diffs. -\a\t -- Keep this list in the same order as getObjectIdentityParts() -- in objectaddress.c.