Commit 19e3bdd6 authored by Tom Lane's avatar Tom Lane

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.
parent 62c3e61e
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200406021 #define CATALOG_VERSION_NO 200406061
#endif #endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * 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 ...@@ -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"); 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"); 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"); DESCR("I/O");
DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" _null_ cstring_in - _null_ )); DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" _null_ cstring_in - _null_ ));
DESCR("I/O"); DESCR("I/O");
...@@ -3320,11 +3320,11 @@ DESCR("less-equal-greater"); ...@@ -3320,11 +3320,11 @@ DESCR("less-equal-greater");
/* send/receive functions */ /* 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_ )); 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"); 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"); 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"); 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"); DESCR("I/O");
DATA(insert OID = 2404 ( int2recv PGNSP PGUID 12 f f t f i 1 21 "2281" _null_ int2recv - _null_ )); DATA(insert OID = 2404 ( int2recv PGNSP PGUID 12 f f t f i 1 21 "2281" _null_ int2recv - _null_ ));
DESCR("I/O"); DESCR("I/O");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* the genbki.sh script reads this file and generates .bki * 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 ...@@ -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"); DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
#define OIDVECTOROID 30 #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 = 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 = 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_ )); 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_ ));
......
...@@ -56,7 +56,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR ...@@ -56,7 +56,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
(0 rows) (0 rows)
-- Look for basic types that don't have an array type. -- 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 SELECT p1.oid, p1.typname
FROM pg_type as p1 FROM pg_type as p1
WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS 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 ...@@ -65,10 +65,9 @@ WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS
p2.typelem = p1.oid); p2.typelem = p1.oid);
oid | typname oid | typname
-----+--------- -----+---------
32 | SET
210 | smgr 210 | smgr
705 | unknown 705 | unknown
(3 rows) (2 rows)
-- Conversion routines must be provided except in 'c' entries. -- Conversion routines must be provided except in 'c' entries.
SELECT p1.oid, p1.typname SELECT p1.oid, p1.typname
...@@ -84,6 +83,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname ...@@ -84,6 +83,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
p2.proargtypes[1] = 'oid'::regtype AND p2.proargtypes[1] = 'oid'::regtype AND
p2.proargtypes[2] = 'int4'::regtype)); p2.proargtypes[2] = 'int4'::regtype));
...@@ -91,7 +92,7 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT ...@@ -91,7 +92,7 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
-----+---------+-----+--------- -----+---------+-----+---------
(0 rows) (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 -- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 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 ...@@ -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 (p1.typelem != 0 AND p1.typlen < 0) AND NOT
(p2.prorettype = p1.oid AND NOT p2.proretset) (p2.prorettype = p1.oid AND NOT p2.proretset)
ORDER BY 1; ORDER BY 1;
oid | typname | oid | proname oid | typname | oid | proname
------+-----------+-----+----------- ------+-----------+-----+---------
32 | SET | 109 | unknownin
1790 | refcursor | 46 | textin 1790 | refcursor | 46 | textin
(2 rows) (1 row)
-- Varlena array types will point to array_in -- Varlena array types will point to array_in
SELECT p1.oid, p1.typname, p2.oid, p2.proname 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 ...@@ -116,20 +116,21 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND
(0 rows) (0 rows)
-- Check for bogus typoutput routines -- 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 -- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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 (p2.oid = 'array_out'::regproc AND
p1.typelem != 0 AND p1.typlen = -1)) p1.typelem != 0 AND p1.typlen = -1))
ORDER BY 1; ORDER BY 1;
oid | typname | oid | proname oid | typname | oid | proname
------+-----------+-----+------------ ------+-----------+-----+---------
32 | SET | 110 | unknownout
1790 | refcursor | 47 | textout 1790 | refcursor | 47 | textout
(2 rows) (1 row)
SELECT p1.oid, p1.typname, p2.oid, p2.proname SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
...@@ -180,6 +181,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname ...@@ -180,6 +181,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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 (p2.oid = 'array_send'::regproc AND
p1.typelem != 0 AND p1.typlen = -1)) p1.typelem != 0 AND p1.typlen = -1))
ORDER BY 1; ORDER BY 1;
......
...@@ -50,7 +50,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR ...@@ -50,7 +50,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
(p1.typtype != 'c' AND p1.typrelid != 0); (p1.typtype != 'c' AND p1.typrelid != 0);
-- Look for basic types that don't have an array type. -- 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 SELECT p1.oid, p1.typname
FROM pg_type as p1 FROM pg_type as p1
...@@ -72,11 +72,13 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname ...@@ -72,11 +72,13 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
p2.proargtypes[1] = 'oid'::regtype AND p2.proargtypes[1] = 'oid'::regtype AND
p2.proargtypes[2] = 'int4'::regtype)); 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 -- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 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 ...@@ -94,12 +96,14 @@ WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND
-- Check for bogus typoutput routines -- 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 -- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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 (p2.oid = 'array_out'::regproc AND
p1.typelem != 0 AND p1.typlen = -1)) p1.typelem != 0 AND p1.typlen = -1))
ORDER BY 1; ORDER BY 1;
...@@ -142,6 +146,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname ...@@ -142,6 +146,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2 FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT 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 = 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 (p2.oid = 'array_send'::regproc AND
p1.typelem != 0 AND p1.typlen = -1)) p1.typelem != 0 AND p1.typlen = -1))
ORDER BY 1; ORDER BY 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment