Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 39C1E6341BE for ; Thu, 27 May 2010 16:28:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 27274-06 for ; Thu, 27 May 2010 19:28:51 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 14CE16322DE for ; Thu, 27 May 2010 16:28:52 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o4RJSlJS031458 for ; Thu, 27 May 2010 16:28:48 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o4OBkuvh053541 for pgsql-sql@postgresql.org; Mon, 24 May 2010 08:46:56 -0300 (ADT) (envelope-from news) From: jr X-Newsgroups: pgsql.sql Subject: Re: safely exchanging primary keys? Date: Mon, 24 May 2010 12:46:55 +0100 Organization: Hub.Org Networking Services Lines: 10 Message-ID: References: <20100524085101.GA21249@apartia.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Thunderbird 2.0.0.4 (X11/20070604) In-Reply-To: <20100524085101.GA21249@apartia.fr> To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-5 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/11 X-Sequence-Number: 34202 hi Louis-David, > tmp := nextval('cabin_type_id_cabin_type_seq'); seems to me you're adding a newly created key value (for which there isn't a record yet). -- regards, jr. (jr@tailorware.org.uk)