From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Petr Jelinek <petr(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Column/type dependency recording inconsistencies |
Date: | 2014-11-09 21:23:22 |
Message-ID: | 11989.1415568202@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Petr Jelinek <petr(at)2ndquadrant(dot)com> writes:
> CREATE TABLE records dependency between relation and type, not between
> column and type, but ALTER TABLE ADD COLUMN and ALTER TABLE ALTER COLUMN
> TYPE record dependencies between relation column and type and not
> between relation and type
Really? I get
regression=# CREATE TYPE droppabletype1 AS (a integer, b text);
CREATE TYPE
regression=# CREATE TABLE testtable (droppablecol1 droppabletype1, undroppablecol1 int);
CREATE TABLE
regression=# CREATE TYPE droppabletype2 AS (a integer, b text);
CREATE TYPE
regression=# alter table testtable add column f3 droppabletype2;
ALTER TABLE
regression=# select pg_describe_object(classid,objid,objsubid) as obj, pg_describe_object(refclassid,refobjid,refobjsubid) as ref, deptype from pg_depend where refobjid = 'droppabletype1'::regtype;
obj | ref | deptype
--------------------------------------+---------------------+---------
composite type droppabletype1 | type droppabletype1 | i
type droppabletype1[] | type droppabletype1 | i
table testtable column droppablecol1 | type droppabletype1 | n
(3 rows)
regression=# select pg_describe_object(classid,objid,objsubid) as obj, pg_describe_object(refclassid,refobjid,refobjsubid) as ref, deptype from pg_depend where refobjid = 'droppabletype2'::regtype;
obj | ref | deptype
-------------------------------+---------------------+---------
composite type droppabletype2 | type droppabletype2 | i
type droppabletype2[] | type droppabletype2 | i
table testtable column f3 | type droppabletype2 | n
(3 rows)
The dependencies look just the same to me ...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Jelinek | 2014-11-09 21:41:45 | Re: Column/type dependency recording inconsistencies |
Previous Message | Petr Jelinek | 2014-11-09 21:06:17 | Column/type dependency recording inconsistencies |