X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ACB8D52800 for ; Thu, 14 Jul 2005 10:04:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82932-09 for ; Thu, 14 Jul 2005 13:04:44 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id E6FC152C30 for ; Thu, 14 Jul 2005 10:04:43 -0300 (ADT) Received: (qmail 11911 invoked by uid 500); 14 Jul 2005 13:05:17 -0000 Date: Thu, 14 Jul 2005 08:05:17 -0500 From: Bruno Wolff III To: lmeadors@apache.org Cc: Michael Fuhr , pgsql-sql@postgresql.org Subject: Re: getting back autonumber just inserted Message-ID: <20050714130517.GA11501@wolff.to> Mail-Followup-To: Bruno Wolff III , lmeadors@apache.org, Michael Fuhr , pgsql-sql@postgresql.org References: <42CD6B58.6060508@techevolution.be> <20050707201433.94901.qmail@web41013.mail.yahoo.com> <20050707203715.GA26528@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/124 X-Sequence-Number: 22102 On Thu, Jul 07, 2005 at 14:47:23 -0600, Larry Meadors wrote: > If you have a trigger on your table that inserts a record in a table > and shares the same sequence, what value do you get back, the > triggered curval, or the currently inserted one? Whichever one was done second. I think it has to be the trigger, because I think the inserted values will be evaluated first (even before aa before trigger) since the triggers need to have access to them.