Re: sequence depends on many tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,
This is the full output with all the columns : 
 WITH
sequences AS
(
SELECT oid,relname FROM pg_class WHERE relkind = 'S'
)
SELECT s.oid as seq_oid,d.*
FROM pg_depend d,sequences s
where
s.oid = d.objid
and d.deptype = 'a'  and d.refobjid::regclass::text='table_A';
 seq_oid | classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype
---------+---------+-------+----------+------------+----------+-------------+---------
   17188 |    1259 | 17188 |        0 |       1259 |    17190 |           1 | a
   16566 |    2604 | 16566 |        0 |       1259 |    17190 |           1 | a
   16704 |    2606 | 16704 |        0 |       1259 |    17190 |           3 | a
   16704 |    2606 | 16704 |        0 |       1259 |    17190 |           5 | a
   16704 |    2606 | 16704 |        0 |       1259 |    17190 |           4 | a
(5 rows)


select *,refobjid::regclass from pg_depend where objid=16704;
 classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype |        refobjid
---------+-------+----------+------------+----------+-------------+---------+-------------------------
    1259 | 16704 |        0 |       2615 |     2200 |           0 | n       | 2200
    2606 | 16704 |        0 |       1259 |    17190 |           3 | a       | table_A
    2606 | 16704 |        0 |       1259 |    17190 |           5 | a       | table_A
    2606 | 16704 |        0 |       1259 |    17190 |           4 | a       | table_A
    1259 | 16704 |        0 |       1259 |    16706 |           1 | a       | table_B
(5 rows)

 select *,refobjid::regclass from pg_depend where objid=16566;
 classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype |       refobjid
---------+-------+----------+------------+----------+-------------+---------+-----------------------
    1259 | 16566 |        0 |       2615 |     2200 |           0 | n       | 2200
    1259 | 16566 |        0 |       1259 |    16568 |           2 | a       | table_C
    2604 | 16566 |        0 |       1259 |    17190 |           1 | a       | table_A
    2604 | 16566 |        0 |       1259 |    17188 |           0 | n       | table_A_seq
(4 rows)

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux