Re: get sequence name from table name

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: get sequence name from table name
Дата
Msg-id 20091204192434.GF4705@alvh.no-ip.org
обсуждение исходный текст
Ответ на get sequence name from table name  (Uwe Maiwald <u.maiwald@kiss-net.de>)
Список pgsql-sql
Uwe Maiwald wrote:
> how to get the name of the sequence that is responsible for setting
> the autoincrement value of a tables primary key column?

You can use the pg_get_serial_sequence() function.  You need the name of
the column in addition to the table name though.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: Gerardo Herzig
Дата:
Сообщение: Re: get sequence name from table name
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Getting more than one row in UNIQUE fields