Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 81558C14E5E for ; Fri, 23 Mar 2012 19:00:12 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SBCWp-0003bL-FK for pgsql-sql@postgresql.org; Fri, 23 Mar 2012 22:00:12 +0000 Received: by pbcun15 with SMTP id un15so2908596pbc.19 for ; Fri, 23 Mar 2012 14:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ZRBPzO4JprnMs+U1W7elofVrF8UqwNQIUPahhgHjEVg=; b=yemiyJc4LP0vbqXCsleyFYWC9NfgG4nQD2a3PNCf75/55FSYaWwEgcN5OedKLKlUOG ksNJ0VvwFbDHt1I7XzfK1lCp3lLvb/5B5kEvJK9tsW0vQ24Z/9txO4nsuwLti4dl4Jao b9tWOR9wHznAClFOWqabWyKk2kLTSln9sPkyQ143S1L8NOOQ27X4UKH0xbIAN6BcO6vP o98gv49YNLJJaGtZKqdA7cii/WQJkxxkaPMj4LLtMhFmBuKjMV3am73Rhil0EL4+s8EG EZVHnfqyuPhVRI2MvI7bpiewZU/Cv0CeyfIO+b275BvGIOJFasGtCwpIWHrhaQWm3aoD j7cg== Received: by 10.68.223.97 with SMTP id qt1mr32661391pbc.6.1332539998666; Fri, 23 Mar 2012 14:59:58 -0700 (PDT) Received: from [172.16.1.224] ([208.187.158.94]) by mx.google.com with ESMTPS id i6sm6630640pbe.18.2012.03.23.14.59.56 (version=SSLv3 cipher=OTHER); Fri, 23 Mar 2012 14:59:57 -0700 (PDT) Message-ID: <4F6CF298.5070600@gmail.com> Date: Fri, 23 Mar 2012 16:00:56 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Can I read the data without commit References: <2388789.tLQtTxa0cR@linux-12> <4F6CEF22.5040205@gmail.com> <2083844.g5gOAHDHN5@linux-12> In-Reply-To: <2083844.g5gOAHDHN5@linux-12> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/68 X-Sequence-Number: 36463 And I believe Jonathon confirmed that you could, with the caveat that you must select from within the transaction. I don't see that you've laid that out your connection stategy so ymmv. On 03/23/2012 03:49 PM, John Fabiani wrote: > Yes I understand - but I want to know is it possible? Can I read the data I > just inserted without a commit. > Johnf > On Friday, March 23, 2012 03:46:10 PM Rob Sargent wrote: >> If possible have the review done before starting the transaction. No >> sense in holding on to that stuff too long. Potential concurrency issues >> etc. >> >> On 03/23/2012 03:40 PM, Jonathan S. Katz wrote: >>> On Mar 23, 2012, at 5:33 PM, John Fabiani wrote: >>>> I start a transaction. >>>> Begin >>>> >>>> Then I insert a lot of data - let's say two hundred rows. >>>> >>>> Now I need to read the same data (so the user can review). >>>> >>>> If the user thinks all is right then >>>> commit. >>>> >>>> Can I read the data I just inserted without committing? >>> >>> Yes, as long as you run your SELECT within the transaction that you >>> started. >>> >>> Jonathan >