Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8e746d

Browse files
committed
Establish the rule that array types should have the same typdelim as their
element types. Since the backend doesn't actually pay attention to the arraytype's delimiter, this has no functional effect, but it seems better for thecatalog entries to be consistent. Per gripe from Greg Mullane and subsequentdiscussion.
1 parent436e6af commite8e746d

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

‎src/backend/commands/typecmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.123 2008/08/28 23:09:45 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.124 2008/09/25 03:28:56 tgl Exp $
1212
*
1313
* DESCRIPTION
1414
* The "DefineFoo" routines take the parse tree and pick out the
@@ -497,7 +497,7 @@ DefineType(List *names, List *parameters)
497497
TYPTYPE_BASE,/* type-type (base type) */
498498
TYPCATEGORY_ARRAY,/* type-category (array) */
499499
false,/* array types are never preferred */
500-
DEFAULT_TYPDELIM,/* array element delimiter */
500+
delimiter,/* array element delimiter */
501501
F_ARRAY_IN,/* input procedure */
502502
F_ARRAY_OUT,/* output procedure */
503503
F_ARRAY_RECV,/* receive procedure */

‎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-2008, 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.488 2008/09/23 09:20:38 heikki Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.489 2008/09/25 03:28:56 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200809231
56+
#defineCATALOG_VERSION_NO200809241
5757

5858
#endif

‎src/include/catalog/pg_type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2008, 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.199 2008/07/30 19:35:13 tgl Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.200 2008/09/25 03:28:56 tgl Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -446,7 +446,7 @@ DATA(insert OID = 1016 ( _int8 PGNSP PGUID -1 f b A f t \054 020 0 array_in
446446
DATA(insertOID=1017 (_pointPGNSPPGUID-1fbAft \05406000array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));
447447
DATA(insertOID=1018 (_lsegPGNSPPGUID-1fbAft \05406010array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));
448448
DATA(insertOID=1019 (_pathPGNSPPGUID-1fbAft \05406020array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));
449-
DATA(insertOID=1020 (_boxPGNSPPGUID-1fbAft \05406030array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));
449+
DATA(insertOID=1020 (_boxPGNSPPGUID-1fbAft \07306030array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));
450450
DATA(insertOID=1021 (_float4PGNSPPGUID-1fbAft \05407000array_inarray_outarray_recvarray_send---ixf0-10_null__null_ ));
451451
#defineFLOAT4ARRAYOID 1021
452452
DATA(insertOID=1022 (_float8PGNSPPGUID-1fbAft \05407010array_inarray_outarray_recvarray_send---dxf0-10_null__null_ ));

‎src/test/regress/expected/type_sanity.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ WHERE p1.typelem = p2.oid AND NOT
254254
-----+---------+-----+---------
255255
(0 rows)
256256

257+
-- Array types should have same typdelim as their element types
258+
SELECT p1.oid, p1.typname, p2.oid, p2.typname
259+
FROM pg_type AS p1, pg_type AS p2
260+
WHERE p1.typarray = p2.oid AND NOT (p1.typdelim = p2.typdelim);
261+
oid | typname | oid | typname
262+
-----+---------+-----+---------
263+
(0 rows)
264+
257265
-- Check for bogus typanalyze routines
258266
SELECT p1.oid, p1.typname, p2.oid, p2.proname
259267
FROM pg_type AS p1, pg_proc AS p2

‎src/test/regress/sql/type_sanity.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ FROM pg_type AS p1, pg_type AS p2
196196
WHEREp1.typelem=p2.oidAND NOT
197197
(p1.typmodin=p2.typmodinANDp1.typmodout=p2.typmodout);
198198

199+
-- Array types should have same typdelim as their element types
200+
201+
SELECTp1.oid,p1.typname,p2.oid,p2.typname
202+
FROM pg_typeAS p1, pg_typeAS p2
203+
WHEREp1.typarray=p2.oidAND NOT (p1.typdelim=p2.typdelim);
204+
199205
-- Check for bogus typanalyze routines
200206

201207
SELECTp1.oid,p1.typname,p2.oid,p2.proname

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp