[HACKERS] pg_class and enum types

2009-05-24 Thread Gevik Babakhani
I was wondering why there is no pg_class record for the enum types. Do 
we treat the enum types differently?


--
Regards,
Gevik


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Robert Haas
On Sun, May 24, 2009 at 4:37 PM, Gevik Babakhani pg...@xs4all.nl wrote:
 I was wondering why there is no pg_class record for the enum types. Do we
 treat the enum types differently?

Because types are stored in pg_type, not pg_class?

...Robert

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Gevik Babakhani

Robert Haas wrote:

On Sun, May 24, 2009 at 4:37 PM, Gevik Babakhani pg...@xs4all.nl wrote:
  

I was wondering why there is no pg_class record for the enum types. Do we
treat the enum types differently?



Because types are stored in pg_type, not pg_class?

...Robert
  

That is certainly not true check the following...

create type test_type as
(
field1 integer,
field2 varchar
);

select * from pg_class where relname='test_type'

--
Regards,
Gevik


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Andrew Dunstan



Gevik Babakhani wrote:
I was wondering why there is no pg_class record for the enum types. Do 
we treat the enum types differently?




Why do you think we should? What would the record look like?

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Andrew Dunstan



Gevik Babakhani wrote:

Robert Haas wrote:
On Sun, May 24, 2009 at 4:37 PM, Gevik Babakhani pg...@xs4all.nl 
wrote:
 
I was wondering why there is no pg_class record for the enum types. 
Do we

treat the enum types differently?



Because types are stored in pg_type, not pg_class?

...Robert
  

That is certainly not true check the following...

create type test_type as
(
field1 integer,
field2 varchar
);

select * from pg_class where relname='test_type'


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


There is no pg_class entry for int either.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Gevik Babakhani

Andrew Dunstan wrote:



Gevik Babakhani wrote:
I was wondering why there is no pg_class record for the enum types. 
Do we treat the enum types differently?




Why do you think we should? What would the record look like?

cheers

andrew
I am not implying whether we  should or we should  not.  I was just  
looking  for the  logic behind it.

Re-reading what I just wrote with your reply gives me hint.

Thanx.

--
Regards,
Gevik


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Tom Lane
Andrew Dunstan and...@dunslane.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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pg_class and enum types

2009-05-24 Thread Gevik Babakhani

Tom Lane wrote:

Andrew Dunstan and...@dunslane.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

  

Thank you :)

--
Regards,
Gevik


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers