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

Commita4df52f

Browse files
committed
Fix breakage of GIN support for varchar[] and cidr[] that I introduced in the
operator-family rewrite. I had mistakenly supposed that these could use thepg_amproc entries for text[] and inet[] respectively. However, binarycompatibility of the underlying types does not make two array types binarycompatible (since they must differ in the header field that gives the elementtype OID), and so the index support code doesn't consider those entriesapplicable. Add back the missing pg_amproc entries, and add an opr_sanityquery to try to catch such mistakes in future. Per report from GregoryMaxwell.
1 parent2abae34 commita4df52f

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
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-2007, 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.420 2007/09/0300:39:21 tgl Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.421 2007/09/0301:18:33 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200709011
56+
#defineCATALOG_VERSION_NO200709021
5757

5858
#endif

‎src/include/catalog/pg_amproc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
2323
* Portions Copyright (c) 1994, Regents of the University of California
2424
*
25-
* $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.67 2007/08/21 01:11:25 tgl Exp $
25+
* $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.68 2007/09/03 01:18:33 tgl Exp $
2626
*
2727
* NOTES
2828
* the genbki.sh script reads this file and generates .bki
@@ -214,6 +214,10 @@ DATA(insert (2745 1009 1009 1 360 ));
214214
DATA(insert (27451009100922743 ));
215215
DATA(insert (27451009100932774 ));
216216
DATA(insert (27451009100942744 ));
217+
DATA(insert (2745101510151360 ));
218+
DATA(insert (27451015101522743 ));
219+
DATA(insert (27451015101532774 ));
220+
DATA(insert (27451015101542744 ));
217221
DATA(insert (2745102310231357 ));
218222
DATA(insert (27451023102322743 ));
219223
DATA(insert (27451023102332774 ));
@@ -254,6 +258,10 @@ DATA(insert (2745 1041 1041 1 926 ));
254258
DATA(insert (27451041104122743 ));
255259
DATA(insert (27451041104132774 ));
256260
DATA(insert (27451041104142744 ));
261+
DATA(insert (27456516511926 ));
262+
DATA(insert (274565165122743 ));
263+
DATA(insert (274565165132774 ));
264+
DATA(insert (274565165142744 ));
257265
DATA(insert (2745100510051350 ));
258266
DATA(insert (27451005100522743 ));
259267
DATA(insert (27451005100532774 ));

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,18 @@ WHERE p2.opfmethod = p1.oid AND p3.amprocfamily = p2.oid AND
940940
--------+---------+----------------+-----------------
941941
(0 rows)
942942

943+
-- Also, check if there are any pg_opclass entries that don't seem to have
944+
-- pg_amproc support.
945+
SELECT amname, opcname, count(*)
946+
FROM pg_am am JOIN pg_opclass op ON opcmethod = am.oid
947+
LEFT JOIN pg_amproc p ON amprocfamily = opcfamily AND
948+
amproclefttype = amprocrighttype AND amproclefttype = opcintype
949+
GROUP BY amname, amsupport, opcname, amprocfamily
950+
HAVING count(*) != amsupport OR amprocfamily IS NULL;
951+
amname | opcname | count
952+
--------+---------+-------
953+
(0 rows)
954+
943955
-- Unfortunately, we can't check the amproc link very well because the
944956
-- signature of the function may be different for different support routines
945957
-- or different base data types.

‎src/test/regress/sql/opr_sanity.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,16 @@ WHERE p2.opfmethod = p1.oid AND p3.amprocfamily = p2.oid AND
751751
p4.amproclefttype=p3.amproclefttypeAND
752752
p4.amprocrighttype=p3.amprocrighttype);
753753

754+
-- Also, check if there are any pg_opclass entries that don't seem to have
755+
-- pg_amproc support.
756+
757+
SELECT amname, opcname,count(*)
758+
FROM pg_am amJOIN pg_opclass opON opcmethod=am.oid
759+
LEFT JOIN pg_amproc pON amprocfamily= opcfamilyAND
760+
amproclefttype= amprocrighttypeAND amproclefttype= opcintype
761+
GROUP BY amname, amsupport, opcname, amprocfamily
762+
HAVINGcount(*)!= amsupportOR amprocfamily ISNULL;
763+
754764
-- Unfortunately, we can't check the amproc link very well because the
755765
-- signature of the function may be different for different support routines
756766
-- or different base data types.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp