Re: [HACKERS] relation complex types

2012-06-02 Thread Darren Duncan

Jaime Casanova wrote:

I knew that we create an entry in pg_type for every table we create,
what i didn't know is that we actually create 2 entries.

for example CREATE TABLE foo (i int); will create types foo and _foo.
so, any reason to create 2 entries?


I don't know offhand; maybe its the corresponding row/tuple type and 
table/relation type?



anyway, what really kept my attention is that CREATE SEQUENCE also
create an entry in pg_type. there is any reason for that?


This I'm fairly sure, is due to a sequence generator being implemented as a 
table/relation-typed variable, so it has a corresponding type like the regular 
table/relation-typed variables in the database.


-- Darren Duncan

--
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] relation complex types

2012-06-02 Thread Tom Lane
Darren Duncan dar...@darrenduncan.net writes:
 Jaime Casanova wrote:
 I knew that we create an entry in pg_type for every table we create,
 what i didn't know is that we actually create 2 entries.
 for example CREATE TABLE foo (i int); will create types foo and _foo.
 so, any reason to create 2 entries?

 I don't know offhand; maybe its the corresponding row/tuple type and 
 table/relation type?

_foo is the array type foo[].  There was bellyaching about the extra
pg_type entries when we added support for arrays of complex types,
but it was decided that trying to suppress them for table rowtypes
would be too, um, complex.

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


[HACKERS] relation complex types

2012-06-01 Thread Jaime Casanova
Hi,

I knew that we create an entry in pg_type for every table we create,
what i didn't know is that we actually create 2 entries.

for example CREATE TABLE foo (i int); will create types foo and _foo.
so, any reason to create 2 entries?
anyway, what really kept my attention is that CREATE SEQUENCE also
create an entry in pg_type. there is any reason for that?

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

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