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

From Tom Lane
Subject Re: Column/type dependency recording inconsistencies
Date
Msg-id 13188.1415570667@sss.pgh.pa.us
Whole thread Raw
In response to Re: 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:
> But the problem with the extension persists, I will try to dig more to 
> find what is the real cause.

Hm ... I reproduced the problem here.  I can't see anything that looks
wrong about the pg_depend entries:
                 obj                   |                          ref                          | deptype 
----------------------------------------+-------------------------------------------------------+---------extension
deptestext                  | schema public                                         | ncomposite type droppabletype1
     | type droppabletype1                                   | itype droppabletype1[]                  | type
droppabletype1                                  | itype droppabletype1                    | schema public
                         | ntype droppabletype1                    | extension deptestext
  | etable testtable                        | schema public                                         | ntable testtable
                     | extension deptestext                                  | etable testtable column droppablecol2
|type droppabletype1                                   | ntable testtable column droppablecol1   | type droppabletype1
                                | ntable testtable column undroppablecol1 | type undroppabletype
         | ntable testtable column undroppablecol2 | type undroppabletype                                  | ntype
testtable[]                      | type testtable                                        | itype testtable
          | table testtable                                       | icomposite type undroppabletype         | type
undroppabletype                                 | itype undroppabletype[]                 | type undroppabletype
                         | itype undroppabletype                   | schema public
  | ntype undroppabletype                   | extension deptestext                                  | etoast table
pg_toast.pg_toast_162813  | table testtable                                       | itype pg_toast.pg_toast_162813
   | toast table pg_toast.pg_toast_162813                  | iindex pg_toast.pg_toast_162813_index   | toast table
pg_toast.pg_toast_162813column chunk_id  | aindex pg_toast.pg_toast_162813_index   | toast table
pg_toast.pg_toast_162813column chunk_seq | a
 
(21 rows)

but sure enough:

d1=# drop extension deptestext;
ERROR:  cannot drop extension deptestext because other objects depend on it
DETAIL:  table testtable column undroppablecol2 depends on type undroppabletype
table testtable column undroppablecol1 depends on type undroppabletype
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

I suspect this is actually a bug in the dependency search logic in DROP.
Don't have the energy to chase it right now though.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: WAL format and API changes (9.5)
Next
From: Petr Jelinek
Date:
Subject: Re: Column/type dependency recording inconsistencies