X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 03984D1B455 for ; Sat, 24 Apr 2004 14:24:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 69282-04 for ; Sat, 24 Apr 2004 14:24:09 -0300 (ADT) Received: from ms-smtp-01-eri0.texas.rr.com (ms-smtp-01.texas.rr.com [24.93.47.40]) by svr1.postgresql.org (Postfix) with ESMTP id C12ADD1B454 for ; Sat, 24 Apr 2004 14:24:07 -0300 (ADT) Received: from 192.168.1.101 (cs2417411-36.houston.rr.com [24.174.11.36]) by ms-smtp-01-eri0.texas.rr.com (8.12.10/8.12.7) with ESMTP id i3OHO5lK015196 for ; Sat, 24 Apr 2004 12:24:05 -0500 (CDT) From: Michael Satterwhite To: pgsql-sql@postgresql.org Subject: Question re: serial Date: Sat, 24 Apr 2004 12:24:03 -0500 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200404241224.05079.michael@weblore.com> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200404/267 X-Sequence-Number: 17642 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a table with a primary key defined as serial unique. When I insert a= =20 row into the table, I need to get the value of that row back so that I can= =20 use it to link rows in another table to it. How do I do that in Postgresql?= I=20 know that I can define a sequence and insert the value manually, but is the= re=20 a way to query the value of the most recently inserted serial column of a= =20 row? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQFAiqK0jeziQOokQnARArJKAJ0SEs8DO6ETa6yZI2Wq6SOmydEwzQCeIwLF on3NovbSaHa+tBrvrynyQfI=3D =3Dd0AB -----END PGP SIGNATURE-----