Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 55FF3476F22 for ; Thu, 13 Jun 2002 17:22:22 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 29515477016 for ; Thu, 13 Jun 2002 17:03:16 -0400 (EDT) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 1526667; Thu, 13 Jun 2002 14:03:15 -0700 Content-Type: text/plain; charset="iso-8859-15" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Charlie Toohey , pgsql-sql@postgresql.org Subject: Re: serial column vs. explicit sequence question Date: Thu, 13 Jun 2002 14:04:28 -0700 X-Mailer: KMail [version 1.4] References: <20020613200344.1B97A476B74@postgresql.org> In-Reply-To: <20020613200344.1B97A476B74@postgresql.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200206131404.28257.josh@agliodbs.com> X-Archive-Number: 200206/186 X-Sequence-Number: 8151 Charlie, > Lets say I need to insert a row into the master table and N rows into the= =20 > detail table. After inserting a row into master, and before detail, I nee= d=20 to=20 > read the master table to obtain the value of the id for the row just=20 > inserted, so I can insert this id as the foreign key value for the N rows= in=20 > the detail table.=20 Hey, what about CURRVAL('sequence_name')? --=20 -Josh Berkus