Re: [PHP] Automatic increment - Mailing list pgsql-sql

From Josh Berkus
Subject Re: [PHP] Automatic increment
Date
Msg-id web-1176343@davinci.ethosmedia.com
Whole thread Raw
List 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 by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Serials
Next
From: Najm Hashmi
Date:
Subject: SQL funtion