Re: [HACKERS] Definitional questions for pg_sequences view
От | Craig Ringer |
---|---|
Тема | Re: [HACKERS] Definitional questions for pg_sequences view |
Дата | |
Msg-id | CAMsr+YFpt0V-8tSRM=dtsALZj-ZhdpHEoCatx3qBGEDgwGDpXw@mail.gmail.com обсуждение исходный текст |
Ответ на | [HACKERS] Definitional questions for pg_sequences view (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On 20 July 2017 at 22:36, Tom Lane <tgl@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 a concern.
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.
В списке pgsql-hackers по дате отправления: