nextval, sequences and sequencenames

Поиск
Список
Период
Сортировка
От Wieger Uffink
Тема nextval, sequences and sequencenames
Дата
Msg-id 3B794D9A.BA8E6EDA@usmedia.nl
обсуждение исходный текст
Ответ на help on delete trigger.  ("Sundararajan" <sdn@srasys.co.in>)
Ответы Re: nextval, sequences and sequencenames  (Gordan Bobic <gordan@bobich.net>)
Список pgsql-general
Hi,

I'm pretty new to PostgreSQL so please bear with me if this is a newbie
question that has been answered before on this list.

I have created several tables containing a SERIAL column-type as primary
key.
What I would like to do is get the last value of these columns after Ive
inserted a new row.

I know I can do this either using nextval('sequence_name') or
curval('sequence_name').

My question:
is there anyway of retreiving the sequence_name corresponding to the
respective column,
knowing just the tablename and columnname?

The reason I need to do this, is because the application I write
dynamicly creates new tables, and I have no way of knowing the sequence
name before hand.

thanks in advance
Wieger
--
Wieger Uffink
tel: +31 20 428 6868
fax: +31 20 470 6905
web: http://www.usmedia.nl

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Is the bug system active?
Следующее
От: Jochem van Dieten
Дата:
Сообщение: Re: PostgresQL equivalent of NOCOUNT