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

Commitbea8af9

Browse files
committed
When dumping CREATE INDEX, must show opclass name if the opclass isn't
in the schema search path. Otherwise pg_dump doesn't correctly dumpscenarios where a custom opclass is created in 'public' and then usedby indexes in other schemas.
1 parentb496645 commitbea8af9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*back to source text
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.155 2003/09/29 18:55:56 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.156 2003/10/02 22:24:54 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -4030,6 +4030,7 @@ get_opclass_name(Oid opclass, Oid actual_datatype,
40304030
Form_pg_opclassopcrec;
40314031
char*opcname;
40324032
char*nspname;
4033+
boolisvisible;
40334034

40344035
/* Domains use their base type's default opclass */
40354036
if (OidIsValid(actual_datatype))
@@ -4049,12 +4050,16 @@ get_opclass_name(Oid opclass, Oid actual_datatype,
40494050
OidIsValid(get_element_type(actual_datatype)))
40504051
actual_datatype=opcrec->opcintype;
40514052
}
4053+
4054+
/* Must force use of opclass name if not in search path */
4055+
isvisible=OpclassIsVisible(opclass);
40524056

4053-
if (actual_datatype!=opcrec->opcintype|| !opcrec->opcdefault)
4057+
if (actual_datatype!=opcrec->opcintype|| !opcrec->opcdefault||
4058+
!isvisible)
40544059
{
40554060
/* Okay, we need the opclass name.Do we need to qualify it? */
40564061
opcname=NameStr(opcrec->opcname);
4057-
if (OpclassIsVisible(opclass))
4062+
if (isvisible)
40584063
appendStringInfo(buf," %s",quote_identifier(opcname));
40594064
else
40604065
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp