From: Tom Lane Date: Sun, 6 Jun 2004 19:07:02 +0000 (+0000) Subject: Minor catalog cleanups for composite-type stuff. Adjust signatures shown X-Git-Tag: REL8_0_0BETA1~426 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19e3bdd6c79568f902dc3613c69f0788f8de583f;p=postgresql Minor catalog cleanups for composite-type stuff. Adjust signatures shown in pg_proc for record_in, record_out, etc to reflect that these routines now make use of the second OID parameter. Remove the ancient SET entry in pg_type, which is now highly unlikely to ever become used again. Adjust type_sanity regression test to match. --- diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index bf6ded488c..a3b6f05c88 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.233 2004/06/02 21:29:29 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.234 2004/06/06 19:06:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200406021 +#define CATALOG_VERSION_NO 200406061 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index cb3279747b..f59528d9f4 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.334 2004/06/02 21:29:29 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.335 2004/06/06 19:07:00 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -3179,9 +3179,9 @@ DATA(insert OID = 2273 ( has_schema_privilege PGNSP PGUID 12 f f t f s 2 16 DESCR("current user privilege on schema by schema oid"); -DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f v 1 2249 "2275" _null_ record_in - _null_ )); +DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f v 2 2249 "2275 26" _null_ record_in - _null_ )); DESCR("I/O"); -DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f v 1 2275 "2249" _null_ record_out - _null_ )); +DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f v 2 2275 "2249 26" _null_ record_out - _null_ )); DESCR("I/O"); DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" _null_ cstring_in - _null_ )); DESCR("I/O"); @@ -3320,11 +3320,11 @@ DESCR("less-equal-greater"); /* send/receive functions */ DATA(insert OID = 2400 ( array_recv PGNSP PGUID 12 f f t f s 2 2277 "2281 26" _null_ array_recv - _null_ )); DESCR("I/O"); -DATA(insert OID = 2401 ( array_send PGNSP PGUID 12 f f t f s 2 17 "2277 26" _null_ array_send - _null_ )); +DATA(insert OID = 2401 ( array_send PGNSP PGUID 12 f f t f s 1 17 "2277" _null_ array_send - _null_ )); DESCR("I/O"); -DATA(insert OID = 2402 ( record_recv PGNSP PGUID 12 f f t f v 1 2249 "2281" _null_ record_recv - _null_ )); +DATA(insert OID = 2402 ( record_recv PGNSP PGUID 12 f f t f v 2 2249 "2281 26" _null_ record_recv - _null_ )); DESCR("I/O"); -DATA(insert OID = 2403 ( record_send PGNSP PGUID 12 f f t f v 1 17 "2249" _null_ record_send - _null_ )); +DATA(insert OID = 2403 ( record_send PGNSP PGUID 12 f f t f v 2 17 "2249 26" _null_ record_send - _null_ )); DESCR("I/O"); DATA(insert OID = 2404 ( int2recv PGNSP PGUID 12 f f t f i 1 21 "2281" _null_ int2recv - _null_ )); DESCR("I/O"); diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 9f68e22fdb..3b9b1dfd5d 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.152 2004/04/01 21:28:45 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.153 2004/06/06 19:07:01 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -304,9 +304,6 @@ DATA(insert OID = 30 ( oidvector PGNSP PGUID INDEX_MAX_KEYS*4 f b t \054 0 26 DESCR("array of INDEX_MAX_KEYS oids, used in system tables"); #define OIDVECTOROID 30 -DATA(insert OID = 32 ( SET PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout - - - i p f 0 -1 0 _null_ _null_ )); -DESCR("set of tuples"); - DATA(insert OID = 71 ( pg_type PGNSP PGUID -1 f c t \054 1247 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); DATA(insert OID = 75 ( pg_attribute PGNSP PGUID -1 f c t \054 1249 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); DATA(insert OID = 81 ( pg_proc PGNSP PGUID -1 f c t \054 1255 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); diff --git a/src/test/regress/expected/type_sanity.out b/src/test/regress/expected/type_sanity.out index 8bd18ca29b..71db213bea 100644 --- a/src/test/regress/expected/type_sanity.out +++ b/src/test/regress/expected/type_sanity.out @@ -56,7 +56,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR (0 rows) -- Look for basic types that don't have an array type. --- NOTE: as of 7.3, this check finds SET, smgr, and unknown. +-- NOTE: as of 7.5, this check finds smgr and unknown. SELECT p1.oid, p1.typname FROM pg_type as p1 WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS @@ -65,10 +65,9 @@ WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS p2.typelem = p1.oid); oid | typname -----+--------- - 32 | SET 210 | smgr 705 | unknown -(3 rows) +(2 rows) -- Conversion routines must be provided except in 'c' entries. SELECT p1.oid, p1.typname @@ -84,6 +83,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = 'cstring'::regtype AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND p2.proargtypes[1] = 'oid'::regtype AND p2.proargtypes[2] = 'int4'::regtype)); @@ -91,7 +92,7 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT -----+---------+-----+--------- (0 rows) --- As of 7.3, this check finds SET and refcursor, which are borrowing +-- As of 7.5, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 @@ -99,11 +100,10 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT (p1.typelem != 0 AND p1.typlen < 0) AND NOT (p2.prorettype = p1.oid AND NOT p2.proretset) ORDER BY 1; - oid | typname | oid | proname -------+-----------+-----+----------- - 32 | SET | 109 | unknownin + oid | typname | oid | proname +------+-----------+-----+--------- 1790 | refcursor | 46 | textin -(2 rows) +(1 row) -- Varlena array types will point to array_in SELECT p1.oid, p1.typname, p2.oid, p2.proname @@ -116,20 +116,21 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND (0 rows) -- Check for bogus typoutput routines --- As of 7.3, this check finds SET and refcursor, which are borrowing +-- As of 7.5, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.oid = 'array_out'::regproc AND p1.typelem != 0 AND p1.typlen = -1)) ORDER BY 1; - oid | typname | oid | proname -------+-----------+-----+------------ - 32 | SET | 110 | unknownout + oid | typname | oid | proname +------+-----------+-----+--------- 1790 | refcursor | 47 | textout -(2 rows) +(1 row) SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 @@ -180,6 +181,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.oid = 'array_send'::regproc AND p1.typelem != 0 AND p1.typlen = -1)) ORDER BY 1; diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql index 3c9004ce56..0c3751ef90 100644 --- a/src/test/regress/sql/type_sanity.sql +++ b/src/test/regress/sql/type_sanity.sql @@ -50,7 +50,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR (p1.typtype != 'c' AND p1.typrelid != 0); -- Look for basic types that don't have an array type. --- NOTE: as of 7.3, this check finds SET, smgr, and unknown. +-- NOTE: as of 7.5, this check finds smgr and unknown. SELECT p1.oid, p1.typname FROM pg_type as p1 @@ -72,11 +72,13 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = 'cstring'::regtype AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND p2.proargtypes[1] = 'oid'::regtype AND p2.proargtypes[2] = 'int4'::regtype)); --- As of 7.3, this check finds SET and refcursor, which are borrowing +-- As of 7.5, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 @@ -94,12 +96,14 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND -- Check for bogus typoutput routines --- As of 7.3, this check finds SET and refcursor, which are borrowing +-- As of 7.5, this check finds refcursor, which is borrowing -- other types' I/O routines SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.oid = 'array_out'::regproc AND p1.typelem != 0 AND p1.typlen = -1)) ORDER BY 1; @@ -142,6 +146,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND + p2.proargtypes[1] = 'oid'::regtype) OR (p2.oid = 'array_send'::regproc AND p1.typelem != 0 AND p1.typlen = -1)) ORDER BY 1;