Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 60B2CC14E5E for ; Fri, 23 Mar 2012 18:49:57 -0300 (ADT) Received: from [76.14.161.106] (helo=newserver.jfcomputer.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SBCMt-0003QZ-9m for pgsql-sql@postgresql.org; Fri, 23 Mar 2012 21:49:56 +0000 Received: from localhost (unknown [127.0.0.1]) by newserver.jfcomputer.com (Postfix) with ESMTP id C03C05F90 for ; Fri, 23 Mar 2012 21:49:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at site Received: from newserver.jfcomputer.com ([127.0.0.1]) by localhost (linux-jfp8.site [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a1PSAySyiKxK for ; Fri, 23 Mar 2012 14:49:42 -0700 (PDT) Received: from linux-12.localnet (unknown [192.168.1.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johnf@jfcomputer.com) by newserver.jfcomputer.com (Postfix) with ESMTPSA id 1FC5DEF0 for ; Fri, 23 Mar 2012 14:49:42 -0700 (PDT) From: John Fabiani To: pgsql-sql@postgresql.org Subject: Re: Can I read the data without commit Date: Fri, 23 Mar 2012 14:49:41 -0700 Message-ID: <2083844.g5gOAHDHN5@linux-12> User-Agent: KMail/4.7.2 (Linux/3.1.9-1.4-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <4F6CEF22.5040205@gmail.com> References: <2388789.tLQtTxa0cR@linux-12> <4F6CEF22.5040205@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Host-Lookup-Failed: Reverse DNS lookup failed for 76.14.161.106 (failed) X-Pg-Spam-Score: 1.6 (+) X-Archive-Number: 201203/67 X-Sequence-Number: 36462 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