Re: pg_class and enum types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Gevik Babakhani <pgdev(at)xs4all(dot)nl>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_class and enum types
Date: 2009-05-24 21:29:45
Message-ID: 11565.1243200585@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Gevik Babakhani wrote:
>> select * from pg_class where relname='test_type'

> It's not so much that enum types are handled specially, but that
> composite types are. :-)

Relations (tables) have always had both pg_class and pg_type entries.
The pg_class entry denotes the relation proper, the pg_type entry
denotes the relation's rowtype.

Composite types have the same two entries, there's just a different
notion of which one is primary.

(The reason a composite type has to have a pg_class entry is that
it has pg_attribute entries, and those have to have something in
pg_class for their attrelid to link to.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gevik Babakhani 2009-05-24 21:32:40 Re: pg_class and enum types
Previous Message Alvaro Herrera 2009-05-24 21:28:55 Re: [HACKERS] pull raw text of a message by message-id