Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 64BE11337B8A for ; Mon, 31 Jan 2011 13:11:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 33512-08 for ; Mon, 31 Jan 2011 17:11:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail19h.g19.rapidsite.net (mail19h.g19.rapidsite.net [204.202.242.57]) by mail.postgresql.org (Postfix) with SMTP id DD8361337B84 for ; Mon, 31 Jan 2011 13:11:14 -0400 (AST) Received: from mx13.stngva01.us.mxservers.net (204.202.242.69) by mail19h.g19.rapidsite.net (RS ver 1.0.95vs) with SMTP id 3-0982233873 for ; Mon, 31 Jan 2011 12:11:13 -0500 (EST) Received: from unknown [161.58.75.15] (EHLO mmm1913.dulles19-verio.com) by va1-mx13.stngva01.us.mxservers.net (mxl_mta-3.1.0-05) with ESMTP id 13de64d4.2018507680.440875.00-012.va1-mx13.stngva01.us.mxservers.net (envelope-from ); Mon, 31 Jan 2011 12:11:13 -0500 (EST) Received: (qmail 87797 invoked from network); 31 Jan 2011 17:11:12 -0000 Received: from unknown (HELO ?192.168.1.184?) (24.5.41.9) by with SMTP; 31 Jan 2011 17:11:12 -0000 Subject: Re: creating and accessing temp table data inside a non-committed transaction Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Leon Starr In-Reply-To: <4D4683EC020000250003A01A@gw.wicourts.gov> Date: Mon, 31 Jan 2011 09:11:11 -0800 Cc: Content-Transfer-Encoding: quoted-printable Message-Id: <361581B2-4CAE-47C6-A300-F60EE79C686E@modelint.com> References: <4D4683EC020000250003A01A@gw.wicourts.gov> To: Kevin Grittner X-Mailer: Apple Mail (2.1082) X-Spam: [F=0.2000000000; S=0.200(2010122901); MH=0.500(2011013121)] X-MAIL-FROM: X-SOURCE-IP: [161.58.75.15] X-SF-Loop: 1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201101/194 X-Sequence-Number: 36634 Ah! That's what I had originally thought. So, if what you are saying = is true,=20 then I just have a bug of some sort. I am NOT using any triggers. It's = just a simple function with deeper function calls nested about 5 levels down. To slightly rephrase: Any database changes (inserts/updates) made by a = transaction are visible inside that transaction. So if I do an insert inside a transaction and = then later, within the same transaction, do a select on the inserted row, I should select the data = that I inserted. Correct? I will do my diagnostics with that in mind. Thanks! - Leon On Jan 31, 2011, at 7:42 AM, Kevin Grittner wrote: > Leon Starr wrote: >=20 >> The problem is that the values x, y and z are inserted into a >> permanent table Q early in the processing of my_func. Then, >> several calls down in deep_func(), still inside my_func, I need to >> access the value of x. I tried to do a select on Q to get the >> value, but I came up NULL! Guessing that is because the >> transaction hasn't committed yet since I am still inside my_func.=20 >> Right? >=20 > I don't think so. Any database changes made by a transaction should > be visible to that transaction. When you say "several calls down in > deep_func()", you don't mean that you are in a BEFORE trigger > function, or a function called from a BEFORE trigger, do you? >=20 > Perhaps you could boil the issue down to a small self-contained > example of the issue? >=20 > -Kevin