Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0CGhMp57807 for ; Fri, 12 Jan 2001 11:43:22 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.3) with HTTP id 1176343 for ; Fri, 12 Jan 2001 08:43:17 -0800 From: "Josh Berkus" Subject: Re: [PHP] Automatic increment To: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.3 Date: Fri, 12 Jan 2001 08:43:17 -0800 Message-ID: In-Reply-To: <20010111215430.A76932@over-yonder.net> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200101/120 X-Sequence-Number: 781 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