Re: Insert zero to auto increment serial column

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Insert zero to auto increment serial column
Дата
Msg-id 20140402144640.GH56668@crankycanuck.ca
обсуждение исходный текст
Ответ на Insert zero to auto increment serial column  (loc <c320sky@gmail.com>)
Список pgsql-general
On Wed, Apr 02, 2014 at 08:17:12AM -0400, loc wrote:
> value, MySQL also works this way.  With PostgreSQL I will need to do a lot
> of code modification to my Aubit4GL programs, since I will need to either
> insert with the key word default or omit the serial column in the insert
> statement.

Why don't you put a DO INSTEAD trigger or rule (I'd suggest the
former) when you put in a 0 to do nextval() instead on the sequence
for the column?

Best regards,

A

--
Andrew Sullivan
ajs@crankycanuck.ca


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Table Vacuum Taking a Long Time
Следующее
От: "Victor Sterpu"
Дата:
Сообщение: Lock problem