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

Commit1899203

Browse files
committed
Fix get_rels_with_domain to not do the wrong thing with views and
composite types that use a domain.
1 parentc7007d1 commit1899203

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/backend/commands/typecmds.c

Lines changed: 10 additions & 3 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.53 2004/02/12 23:41:02 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.54 2004/05/05 17:06:56 tgl Exp $
1212
*
1313
* DESCRIPTION
1414
* The "DefineFoo" routines take the parse tree and pick out the
@@ -1685,7 +1685,7 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode)
16851685
Form_pg_attributepg_att;
16861686
intptr;
16871687

1688-
/* Ignore dependees that aren't user columns oftables */
1688+
/* Ignore dependees that aren't user columns ofrelations */
16891689
/* (we assume system columns are never of domain types) */
16901690
if (pg_depend->classid!=RelOid_pg_class||
16911691
pg_depend->objsubid <=0)
@@ -1709,7 +1709,14 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode)
17091709
Relationrel;
17101710

17111711
/* Acquire requested lock on relation */
1712-
rel=heap_open(pg_depend->objid,lockmode);
1712+
rel=relation_open(pg_depend->objid,lockmode);
1713+
1714+
/* It could be a view or composite type; if so ignore it */
1715+
if (rel->rd_rel->relkind!=RELKIND_RELATION)
1716+
{
1717+
relation_close(rel,lockmode);
1718+
continue;
1719+
}
17131720

17141721
/* Build the RelToCheck entry with enough space for all atts */
17151722
rtc= (RelToCheck*)palloc(sizeof(RelToCheck));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp