Skip to content

Commit 19e3bdd

Browse files
committed
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.
1 parent 62c3e61 commit 19e3bdd

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.233 2004/06/02 21:29:29 momjian Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.234 2004/06/06 19:06:59 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 200406021
56+
#define CATALOG_VERSION_NO 200406061
5757

5858
#endif

src/include/catalog/pg_proc.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.334 2004/06/02 21:29:29 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.335 2004/06/06 19:07:00 tgl Exp $
1111
*
1212
* NOTES
1313
* 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
31793179
DESCR("current user privilege on schema by schema oid");
31803180

31813181

3182-
DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f v 1 2249 "2275" _null_ record_in - _null_ ));
3182+
DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f v 2 2249 "2275 26" _null_ record_in - _null_ ));
31833183
DESCR("I/O");
3184-
DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f v 1 2275 "2249" _null_ record_out - _null_ ));
3184+
DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f v 2 2275 "2249 26" _null_ record_out - _null_ ));
31853185
DESCR("I/O");
31863186
DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" _null_ cstring_in - _null_ ));
31873187
DESCR("I/O");
@@ -3320,11 +3320,11 @@ DESCR("less-equal-greater");
33203320
/* send/receive functions */
33213321
DATA(insert OID = 2400 ( array_recv PGNSP PGUID 12 f f t f s 2 2277 "2281 26" _null_ array_recv - _null_ ));
33223322
DESCR("I/O");
3323-
DATA(insert OID = 2401 ( array_send PGNSP PGUID 12 f f t f s 2 17 "2277 26" _null_ array_send - _null_ ));
3323+
DATA(insert OID = 2401 ( array_send PGNSP PGUID 12 f f t f s 1 17 "2277" _null_ array_send - _null_ ));
33243324
DESCR("I/O");
3325-
DATA(insert OID = 2402 ( record_recv PGNSP PGUID 12 f f t f v 1 2249 "2281" _null_ record_recv - _null_ ));
3325+
DATA(insert OID = 2402 ( record_recv PGNSP PGUID 12 f f t f v 2 2249 "2281 26" _null_ record_recv - _null_ ));
33263326
DESCR("I/O");
3327-
DATA(insert OID = 2403 ( record_send PGNSP PGUID 12 f f t f v 1 17 "2249" _null_ record_send - _null_ ));
3327+
DATA(insert OID = 2403 ( record_send PGNSP PGUID 12 f f t f v 2 17 "2249 26" _null_ record_send - _null_ ));
33283328
DESCR("I/O");
33293329
DATA(insert OID = 2404 ( int2recv PGNSP PGUID 12 f f t f i 1 21 "2281" _null_ int2recv - _null_ ));
33303330
DESCR("I/O");

src/include/catalog/pg_type.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.152 2004/04/01 21:28:45 tgl Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.153 2004/06/06 19:07:01 tgl Exp $
1212
*
1313
* NOTES
1414
* 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
304304
DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
305305
#define OIDVECTOROID 30
306306

307-
DATA(insert OID = 32 ( SET PGNSP PGUID -1 f b t \054 0 0 unknownin unknownout - - - i p f 0 -1 0 _null_ _null_ ));
308-
DESCR("set of tuples");
309-
310307
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_ ));
311308
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_ ));
312309
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_ ));

src/test/regress/expected/type_sanity.out

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
5656
(0 rows)
5757

5858
-- Look for basic types that don't have an array type.
59-
-- NOTE: as of 7.3, this check finds SET, smgr, and unknown.
59+
-- NOTE: as of 7.5, this check finds smgr and unknown.
6060
SELECT p1.oid, p1.typname
6161
FROM pg_type as p1
6262
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
6565
p2.typelem = p1.oid);
6666
oid | typname
6767
-----+---------
68-
32 | SET
6968
210 | smgr
7069
705 | unknown
71-
(3 rows)
70+
(2 rows)
7271

7372
-- Conversion routines must be provided except in 'c' entries.
7473
SELECT p1.oid, p1.typname
@@ -84,26 +83,27 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
8483
FROM pg_type AS p1, pg_proc AS p2
8584
WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
8685
((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR
86+
(p2.pronargs = 2 AND p2.proargtypes[0] = 'cstring'::regtype AND
87+
p2.proargtypes[1] = 'oid'::regtype) OR
8788
(p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
8889
p2.proargtypes[1] = 'oid'::regtype AND
8990
p2.proargtypes[2] = 'int4'::regtype));
9091
oid | typname | oid | proname
9192
-----+---------+-----+---------
9293
(0 rows)
9394

94-
-- As of 7.3, this check finds SET and refcursor, which are borrowing
95+
-- As of 7.5, this check finds refcursor, which is borrowing
9596
-- other types' I/O routines
9697
SELECT p1.oid, p1.typname, p2.oid, p2.proname
9798
FROM pg_type AS p1, pg_proc AS p2
9899
WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
99100
(p1.typelem != 0 AND p1.typlen < 0) AND NOT
100101
(p2.prorettype = p1.oid AND NOT p2.proretset)
101102
ORDER BY 1;
102-
oid | typname | oid | proname
103-
------+-----------+-----+-----------
104-
32 | SET | 109 | unknownin
103+
oid | typname | oid | proname
104+
------+-----------+-----+---------
105105
1790 | refcursor | 46 | textin
106-
(2 rows)
106+
(1 row)
107107

108108
-- Varlena array types will point to array_in
109109
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
116116
(0 rows)
117117

118118
-- Check for bogus typoutput routines
119-
-- As of 7.3, this check finds SET and refcursor, which are borrowing
119+
-- As of 7.5, this check finds refcursor, which is borrowing
120120
-- other types' I/O routines
121121
SELECT p1.oid, p1.typname, p2.oid, p2.proname
122122
FROM pg_type AS p1, pg_proc AS p2
123123
WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
124124
((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
125+
(p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND
126+
p2.proargtypes[1] = 'oid'::regtype) OR
125127
(p2.oid = 'array_out'::regproc AND
126128
p1.typelem != 0 AND p1.typlen = -1))
127129
ORDER BY 1;
128-
oid | typname | oid | proname
129-
------+-----------+-----+------------
130-
32 | SET | 110 | unknownout
130+
oid | typname | oid | proname
131+
------+-----------+-----+---------
131132
1790 | refcursor | 47 | textout
132-
(2 rows)
133+
(1 row)
133134

134135
SELECT p1.oid, p1.typname, p2.oid, p2.proname
135136
FROM pg_type AS p1, pg_proc AS p2
@@ -180,6 +181,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
180181
FROM pg_type AS p1, pg_proc AS p2
181182
WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT
182183
((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
184+
(p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND
185+
p2.proargtypes[1] = 'oid'::regtype) OR
183186
(p2.oid = 'array_send'::regproc AND
184187
p1.typelem != 0 AND p1.typlen = -1))
185188
ORDER BY 1;

src/test/regress/sql/type_sanity.sql

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
5050
(p1.typtype != 'c' AND p1.typrelid != 0);
5151

5252
-- Look for basic types that don't have an array type.
53-
-- NOTE: as of 7.3, this check finds SET, smgr, and unknown.
53+
-- NOTE: as of 7.5, this check finds smgr and unknown.
5454

5555
SELECT p1.oid, p1.typname
5656
FROM pg_type as p1
@@ -72,11 +72,13 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
7272
FROM pg_type AS p1, pg_proc AS p2
7373
WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
7474
((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR
75+
(p2.pronargs = 2 AND p2.proargtypes[0] = 'cstring'::regtype AND
76+
p2.proargtypes[1] = 'oid'::regtype) OR
7577
(p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
7678
p2.proargtypes[1] = 'oid'::regtype AND
7779
p2.proargtypes[2] = 'int4'::regtype));
7880

79-
-- As of 7.3, this check finds SET and refcursor, which are borrowing
81+
-- As of 7.5, this check finds refcursor, which is borrowing
8082
-- other types' I/O routines
8183
SELECT p1.oid, p1.typname, p2.oid, p2.proname
8284
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
9496

9597
-- Check for bogus typoutput routines
9698

97-
-- As of 7.3, this check finds SET and refcursor, which are borrowing
99+
-- As of 7.5, this check finds refcursor, which is borrowing
98100
-- other types' I/O routines
99101
SELECT p1.oid, p1.typname, p2.oid, p2.proname
100102
FROM pg_type AS p1, pg_proc AS p2
101103
WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
102104
((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
105+
(p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND
106+
p2.proargtypes[1] = 'oid'::regtype) OR
103107
(p2.oid = 'array_out'::regproc AND
104108
p1.typelem != 0 AND p1.typlen = -1))
105109
ORDER BY 1;
@@ -142,6 +146,8 @@ SELECT p1.oid, p1.typname, p2.oid, p2.proname
142146
FROM pg_type AS p1, pg_proc AS p2
143147
WHERE p1.typsend = p2.oid AND p1.typtype in ('b', 'p') AND NOT
144148
((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
149+
(p2.pronargs = 2 AND p2.proargtypes[0] = p1.oid AND
150+
p2.proargtypes[1] = 'oid'::regtype) OR
145151
(p2.oid = 'array_send'::regproc AND
146152
p1.typelem != 0 AND p1.typlen = -1))
147153
ORDER BY 1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy