Re: sequence depends on many tables

From: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: sequence depends on many tables
Date: 2019-09-29 06:05:15
Message-ID: CA+t6e1muOmnvyU7AzgCAx2RK1-8+YkKh5eo-csZETh1GGazbog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mariel Cherkassky 2019-09-29 09:46:31 distinct on extract returns composite type
Previous Message Edilmar Alves 2019-09-27 14:25:24 Re: Slow pg_publication_tables with many schemas and tables