Re: [PHP] Automatic increment

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [PHP] Automatic increment
Date: 2001-01-12 16:43:17
Message-ID: web-1176343@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php 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

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Josh Berkus 2001-01-12 17:02:13 PL/PGSQL Array Parameters
Previous Message Adam Lang 2001-01-12 14:13:12 Re: ODBC ... cont

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-01-12 17:02:13 PL/PGSQL Array Parameters
Previous Message Josh Berkus 2001-01-12 16:35:49 Re: Serials