Re: [PHP] Automatic increment

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: [PHP] Automatic increment
Дата
Msg-id web-1176343@davinci.ethosmedia.com
обсуждение исходный текст
Список pgsql-sql
GH, svangemond,

> > Many people do the first SELECT on a form, stuff the
> result in a hidden
> > variable, then do the INSERT in the form's handler.
> This prevents the
> > double- (or triple-) clicking of "submit" resulting in
> extra database
> > inserts.

Actually, that raises a very good question:

If I have a defined sequence 'universal_sq', and I want to
insert rows into a table using 'universal_sq', is there any
reason *not* to use the DEFAULT NEXTVAL('universal_sq')
declaration in the table definition?

For example, if I want to locate the NEXTVAL. do a bunch of
stuff, and then insert the record, does this obligate me to
take the DEFAULT NEXTVAL out of the table and do it the
NEXTVAL insertion in my functions, or is it irrelevant?

-Josh Berkus


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Serials
Следующее
От: Najm Hashmi
Дата:
Сообщение: SQL funtion