Wiki editor request - Mailing list pgsql-www

From Nicholas Meyer
Subject Wiki editor request
Date
Msg-id CANMCTvKyK-hL9g+_ocWKBheCz7apC+DCUbZiaXhFbrJ_CQnoXA@mail.gmail.com
Whole thread Raw
Responses Re: Wiki editor request  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List 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_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

pgsql-www by date:

Previous
From: Vibhor Kumar
Date:
Subject: Re: Wiki editor request -Speaker Bureau
Next
From: Alvaro Herrera
Date:
Subject: Re: Wiki editor request