Received: from server.beierfeld.kabeljournal.de (pD9508740.dip.t-dialin.net [217.80.135.64]) by postgresql.org (Postfix) with SMTP id C3F1747594C for ; Thu, 28 Mar 2002 03:03:48 -0500 (EST) Received: (qmail 22569 invoked from network); 28 Mar 2002 08:03:48 -0000 Received: from station158.beierfeld.kabeljournal.de (HELO km3.de) (192.168.128.158) by server.beierfeld.kabeljournal.de with SMTP; 28 Mar 2002 08:03:48 -0000 Message-ID: <3CA2CF1F.3451C5B4@km3.de> Date: Thu, 28 Mar 2002 09:06:55 +0100 From: Andre Schubert X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.2.19-6.2.12 i586) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Last_Inserted Value Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/329 X-Sequence-Number: 3863 Hi all, i have a little question on getting the last inserted value from a table. Lets say i have a transaction which does the following. insert into foo values(1); insert into bar values(2); insert into foobar values(3); All three tables use the same sequence to increment their id. I want to know if it is possible to find the id of the inserted value of foo. Can i do a select id from foo order by id desc limit 1 before the end of the transaction, does this return exactly the row i inserted for this transaction? Thanks in advance