From: | Nicholas Meyer <nickaristocrates(at)gmail(dot)com> |
---|---|
To: | pgsql-www(at)postgresql(dot)org |
Subject: | Wiki editor request |
Date: | 2023-08-22 16:35:06 |
Message-ID: | CANMCTvKyK-hL9g+_ocWKBheCz7apC+DCUbZiaXhFbrJ_CQnoXA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-www |
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 | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2023-08-22 16:37:30 | Re: Wiki editor request |
Previous Message | Vibhor Kumar | 2023-08-21 13:19:05 | Re: Wiki editor request -Speaker Bureau |