Received: from Main.eurocom.od.ua (root@Main.EuroCom.Od.UA [212.15.128.6]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA77267 for ; Tue, 18 Apr 2000 03:05:49 -0400 (EDT) (envelope-from gsmith@eurocom.od.ua) Received: from eurocom.od.ua (FarHost.EuroCom.Od.UA [212.15.128.42]) by Main.eurocom.od.ua (8.10.0/8.10.0) with ESMTP id e3I75cK25234 for ; Tue, 18 Apr 2000 10:05:39 +0300 Message-ID: <38FC094F.EBF59629@eurocom.od.ua> Date: Tue, 18 Apr 2000 10:05:51 +0300 From: "Vladimir V. Zolotych" X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: sequence Content-Type: multipart/alternative; boundary="------------32EAB34F404BC446869A275A" X-Archive-Number: 200004/64 --------------32EAB34F404BC446869A275A Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Hello all What is the safe way to add record to a table and get it id (generated by a sequence) consistently? E.g. 1) add record (INSERT INTO...) to a table (the record's id will be generated automatically due the ``id SERIAL'' column were defined). 2) get the id of a just created record. Thanks -- Vladimir Zolotych gsmith@eurocom.od.ua --------------32EAB34F404BC446869A275A Content-Type: text/html; charset=koi8-r Content-Transfer-Encoding: 7bit Hello all

What is the safe way to add record to a table
and get it id (generated by a sequence) consistently?

E.g.
1) add record (INSERT INTO...) to a table
(the record's id will be generated
automatically due the ``id SERIAL'' column were defined).

2) get the id of a just created record.

Thanks
 

-- 
Vladimir Zolotych                         gsmith@eurocom.od.ua
  --------------32EAB34F404BC446869A275A--