Getting the column to a which a sequence belongs.

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Getting the column to a which a sequence belongs.
Дата
Msg-id h76m6t$ne7$1@ger.gmane.org
обсуждение исходный текст
Ответы Re: Getting the column to a which a sequence belongs.
Список pgsql-general
Hi,

I'm trying to extend the Postgres support in my SQL tool. I'm trying to recreate the SQL for a sequence, and I wonder
ifthere is a way to find out the column to which a sequence "belongs".  

I'm talking either about sequences that are created automatically by PG when using the serial datatype or sequences
thathave been changed using ALTER SEQUENCE ... OWNED BY ... 

I know I can get the sequence that belongs to a column using pg_get_serial_sequence() (although only in 8.4), but I'm
lookingfor the other way: given a sequence find out if it's "owned" by a column.  

So far "debugging" psql using the -E option didn't show up anything and I couldn't find any hints in the system
catalogsdocumentation. 

Is this possible at all? As neither psql nor pgAdmin display this information, I suspect it's not.

Regards
Thomas

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Select data for current week only
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [SQL] Data audit trail techniques in postgresql