Re: Column/type dependency recording inconsistencies - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Column/type dependency recording inconsistencies
Date
Msg-id 11989.1415568202@sss.pgh.pa.us
Whole thread Raw
In response to Column/type dependency recording inconsistencies  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: Column/type dependency recording inconsistencies  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
Petr Jelinek <petr@2ndquadrant.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| itype droppabletype1[]                | type droppabletype1 | itable testtable column droppablecol1 |
typedroppabletype1 | 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 |
itypedroppabletype2[]         | type droppabletype2 | itable testtable column f3     | type droppabletype2 | n
 
(3 rows)

The dependencies look just the same to me ...
        regards, tom lane



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Column/type dependency recording inconsistencies
Next
From: Petr Jelinek
Date:
Subject: Re: Column/type dependency recording inconsistencies