Thread: Wiki editor request
Hi,
I would like editor access to the wiki, my username is Nmeyer (https://wiki.postgresql.org/wiki/User:Nmeyer) and I would like to modify the snippet at the end of https://wiki.postgresql.org/wiki/Fixing_Sequences which is missing a condition on classid = 'pg_class'::regclass in the predicate:
select ns.nspname as schema_name, seq.relname as seq_name from pg_class as seq join pg_namespace ns on (seq.relnamespace=ns.oid) where seq.relkind = 'S' and not exists (select * from pg_depend where objid=seq.oid and deptype='a') order by seq.relname;
As is, the query (copied above) has false negatives in the case where oid values happen to collide across different pg_depend.classid values.
Fixed version:
select ns.nspname as schema_name, seq.relname as seq_name from pg_class as seq join pg_namespace ns on (seq.relnamespace=ns.oid) where seq.relkind = 'S' and not exists (select * from pg_depend where objid=seq.oid and deptype='a' and classid = 'pg_class'::regclass) order by seq.relname;
Nick Meyer
Hi Nick, On 2023-Aug-22, Nicholas Meyer wrote: > I would like editor access to the wiki, my username is Nmeyer ( > https://wiki.postgresql.org/wiki/User:Nmeyer) and I would like to modify > the snippet at the end of https://wiki.postgresql.org/wiki/Fixing_Sequences > which is missing a condition on classid = 'pg_class'::regclass in the > predicate: Done, edit away. Thanks -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/