Subject: Wiki editor request

From: Nicholas Meyer <[email-masked]>
Date: Tue, 22 Aug 2023 09:35:06 -0700

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_namefrom pg_class
as seqjoin 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_namefrom pg_class
as seqjoin 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

---

From: Alvaro Herrera <[email-masked]>
Date: Tue, 22 Aug 2023 18:37:30 +0200

Hi Nick,

> which is missing a condition on classid = 'pg_class'::regclass in the

Done, edit away.  Thanks

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/