Re: Sequence names have 64 character limit?

Поиск
Список
Период
Сортировка
От Jerry Sievers
Тема Re: Sequence names have 64 character limit?
Дата
Msg-id 87lizvc4yz.fsf@comcast.net
обсуждение исходный текст
Ответ на Re: Sequence names have 64 character limit?  (Carlo Stonebanks <carlo@stonebanks.ca>)
Список pgsql-general
Carlo Stonebanks <carlo@stonebanks.ca> writes:

> Thanks Adrian and Jerry.
>
> Technically, the best way to know which sequence a column is dependent on is
> to actually query for it. I have functions which query
> information_schema.columns and run a regex_replace to extract the sequence
> name from the defaulting nextval() expression. This is better than demanding
> that sequence names are predictable, but I wonder if there isn't a better
> query to run that doesn't require parsing texts? Obviously PG knows about
> the sequence's relation, probably via a dependency that finds it by
> rendering the text to regclass to an OID... but this stuff makes me nervous.

Nervous or otherwise, if your sequences are owned by the tables either
by their implicit creation with SERIAL keyword or a later ALTER SEQUENCE
OWNED BY, then querying the class and depend catalogues is your most
reliable bet.

--
Jerry Sievers
Postgres DBA/Development Consulting
e: gsievers19@comcast.net
p: 305.321.1144

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

Предыдущее
От: Darren Duncan
Дата:
Сообщение: Re: Access to NEW.column outside of a trigger function.
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Sequence names have 64 character limit?