Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0DHH-0005lD-Ui for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jul 2013 16:11:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V0DHH-0007Yp-Eo for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jul 2013 16:11:31 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0DHG-0007Yj-8I for pgsql-hackers@postgresql.org; Fri, 19 Jul 2013 16:11:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0DHD-0006bj-UT for pgsql-hackers@postgresql.org; Fri, 19 Jul 2013 16:11:29 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r6JGBOHP025212; Fri, 19 Jul 2013 12:11:24 -0400 (EDT) From: Tom Lane To: Andres Freund cc: Hiroshi Inoue , Robert Haas , pgsql-hackers@postgresql.org, pgsql-odbc@postgresql.org Subject: Re: [ODBC] getting rid of SnapshotNow In-reply-to: <20130719160230.GA32534@alap2.anarazel.de> References: <51E95FF7.4000004@tpf.co.jp> <20130719160230.GA32534@alap2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 19 Jul 2013 18:02:30 +0200" Date: Fri, 19 Jul 2013 12:11:23 -0400 Message-ID: <25211.1374250283@sss.pgh.pa.us> X-Pg-Spam-Score: -0.4 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2013-07-20 00:49:11 +0900, Hiroshi Inoue wrote: >> Using SnapshotSelf instead of SnapshotNow for currtid_ () wouldn't >> matter. > I think it actually might. You could get into dicey situations if you > use currtid_ in a query performing updates or inserts because it would > see the to-be-inserted tuple... I'm pretty sure Hiroshi-san was only opining about whether it would matter for ODBC's usage. IIUC, ODBC is using this function to re-fetch rows that it inserted, updated, or at least selected-for-update in a previous command of the current transaction, so actually any snapshot would do fine. In any case, since I moved the goalposts by suggesting that SnapshotSelf is just as dangerous as SnapshotNow, what we need to know is whether it'd be all right to change this code to use a fresh MVCC snapshot; and if not, why not. It's pretty hard to see a reason why client-side code would want to make use of the results of a non-MVCC snapshot. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers