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)
16851685Form_pg_attribute pg_att ;
16861686int ptr ;
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) */
16901690if (pg_depend -> classid != RelOid_pg_class ||
16911691pg_depend -> objsubid <=0 )
@@ -1709,7 +1709,14 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode)
17091709Relation rel ;
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 */
17151722rtc = (RelToCheck * )palloc (sizeof (RelToCheck ));