Re: Getting the currently used sequence for a SERIAL column

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Getting the currently used sequence for a SERIAL column
Дата
Msg-id nu4p17$hl6$1@blaine.gmane.org
обсуждение исходный текст
Ответ на Getting the currently used sequence for a SERIAL column  (Hanne Moa <hanne.moa@gmail.com>)
Список pgsql-general
> Is this to be regarded as internal API or is it safe to use this to
> find the correct sequence?

I think it's safe to use.


> Furthermore, what's stored in the column seems to be a string of the
> format "nextval('sequencename'::regclass)". Is there a function to
> parse this, to return just the sequence name, or will the sequence
> name always be without for instance a schema name so that a naive
> parser of our own will do? Googling found no candidates.

In my experience, this could also be in the form "nextval('schema.sequencename'::regclass)"
if the sequence is not in the same schema as the table.

Thomas

В списке pgsql-general по дате отправления:

Предыдущее
От: Hanne Moa
Дата:
Сообщение: Getting the currently used sequence for a SERIAL column
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_upgrade not able to cope with pg_largeobject being in a different tablespace