Lists: | pgsql-hackers |
---|
From: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | relation complex types |
Date: | 2012-06-02 05:49:25 |
Message-ID: | CAJKUy5iVdjfTW5a7Lf_zbNSeaedfkEPFUujAmsDMR6bEF2nTeQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
From: | Darren Duncan <darren(at)darrenduncan(dot)net> |
---|---|
To: | Jaime Casanova <jaime(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: relation complex types |
Date: | 2012-06-02 19:55:00 |
Message-ID: | 4FCA6F94.20300@darrenduncan.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Darren Duncan <darren(at)darrenduncan(dot)net> |
Cc: | Jaime Casanova <jaime(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: relation complex types |
Date: | 2012-06-02 21:13:07 |
Message-ID: | 23608.1338671587@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Darren Duncan <darren(at)darrenduncan(dot)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