On 20 July 2017 at 22:36, Tom Lane <t...@sss.pgh.pa.us> wrote:
> This could be fixed if it were possible to translate to
> select * from pg_sequences where seqoid = 'my_seq'::regclass;
> but the view isn't exposing the sequence OID. Should it?
It probably should. It's not part of information_schema, it's in
pg_catalog, and it's entirely reasonable to join on oids.
The relfilenode for the sequence can change, but the sequence oid won't
unless we actually drop and re-create it, so the weird issues with alter
sequence operations being partly transactional and partly not shouldn't be
If it's to be a convenience view, it should possibly also expose the OWNED
BY relation oid IMO, if any. You have the sequence oid you can join on
pg_class and grab the relowner, so it's not a great hassle if it's missing,
but if it's a view to help users out exposing that would seem sensible.
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services