Re: sequences and dependences

Поиск
Список
Период
Сортировка
От Ioannis Tambouras
Тема Re: sequences and dependences
Дата
Msg-id 20080524150640.GA24460@akroninc.net
обсуждение исходный текст
Ответ на sequences and dependences  (Laurent ROCHE <laurent_roche@yahoo.com>)
Список pgsql-general
>   I would like to write a request where I would get the table name and
>   column name of a sequence.
>   In fact I want the opposite of pg_get_serial_sequence !


You are looking for refobjid in pg_depend, but this
time the sequence could be a dependent to more than table.

A query like the one bellow is should give you the name of the table,
assuming you account for the correct namespace; it will not automatically
show the name of the column:

select objid::regclass, refobjid::regclass
from pg_depend
where objid::regclass::text = 'person_id_seq' ;


Thanks
Ioannis Tambouras

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: XML2 module and xpath_table
Следующее
От: Greg Smith
Дата:
Сообщение: Re: sequences and dependences