Re: Question (or feature request) on serial datatype

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Question (or feature request) on serial datatype
Дата
Msg-id 20030723152839.GA21046@wolff.to
обсуждение исходный текст
Ответ на Question (or feature request) on serial datatype  ("Kian Spongsveen (spam account)" <spam@kian.org>)
Список pgsql-general
On Tue, Jul 22, 2003 at 12:24:00 +0200,
  "Kian Spongsveen (spam account)" <spam@kian.org> wrote:
> could directly call currval *after* inserting. Doing a manual nextval()
> before the insert is OK, too, but from my understanding it needs the sequence
> name and not the column name?

Yes, nextval expects the name of the sequence passed as a string.

> When the RDBMS is decided, you want to hide the annoyances of each platform
> as much as possible. Having to know at a later phase that a certain sequence
> name has been associated with the serial column is unneccessary for the
> front-end developers. I can't find any simple way of programatically finding
> the sequence name either. I believe this is much simpler in Sybase ASE/ASA,
> Microsoft Access/SQL Server and MySQL so PostgreSQL should improve the
> functionality too?

The sequence names are picked using a pattern that you could just use
if you avoid a few things in your naming convention. Or alternatively
you could manually create the sequences using your own rules for namming.
Unless there is a conflict or the name is too long a sequence for a serial
column is named tablename_columnname_seq .

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

Предыдущее
От: "Claudio Lapidus"
Дата:
Сообщение: 7.4dev or beta version
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: 7.4dev or beta version