Re: sequence depends on many tables - Mailing list pgsql-performance

From Mariel Cherkassky
Subject Re: sequence depends on many tables
Date
Msg-id CA+t6e1muOmnvyU7AzgCAx2RK1-8+YkKh5eo-csZETh1GGazbog@mail.gmail.com
Whole thread Raw
In response to Re: sequence depends on many tables  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: sequence depends on many tables
List pgsql-performance
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)

pgsql-performance by date:

Previous
From: Edilmar Alves
Date:
Subject: Re: Slow pg_publication_tables with many schemas and tables
Next
From: Mariel Cherkassky
Date:
Subject: distinct on extract returns composite type