Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uzy4W-0008DM-9E for pgsql-odbc@arkaria.postgresql.org; Thu, 18 Jul 2013 23:57:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uzy4V-0006YT-Oj for pgsql-odbc@arkaria.postgresql.org; Thu, 18 Jul 2013 23:57:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uzy4U-0006X8-Cg for pgsql-odbc@postgresql.org; Thu, 18 Jul 2013 23:57:18 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uzy4P-0008CB-SE for pgsql-odbc@postgresql.org; Thu, 18 Jul 2013 23:57:18 +0000 Received: (qmail 31384 invoked by uid 512); 18 Jul 2013 23:57:05 -0000 Received: from unknown (HELO ?127.0.0.1?) (100.126.1.62) by sd2.tpf-fw-c.co.jp with SMTP; 18 Jul 2013 23:57:05 -0000 Message-ID: <51E880CD.6060304@tpf.co.jp> Date: Fri, 19 Jul 2013 08:57:01 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Robert Haas CC: Tom Lane , pgsql-hackers@postgresql.org, pgsql-odbc@postgresql.org Subject: Re: [HACKERS] getting rid of SnapshotNow References: <3461.1374158054@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org (2013/07/18 23:54), Robert Haas wrote: > On Thu, Jul 18, 2013 at 10:34 AM, Tom Lane wrote: >> Robert Haas writes: >>> 1. snapshot-error-v1.patch introduces a new special snapshot, called >>> SnapshotError. In the cases where we set SnapshotNow as a sort of >>> default snapshot, this patch changes the code to use SnapshotError >>> instead. This affects scan->xs_snapshot in genam.c and >>> estate->es_snapshot in execUtils.c. This passes make check-world, so >>> apparently there is no code in the core distribution that does this. >>> However, this is safer for third-party code, which will ERROR instead >>> of seg faulting. The alternative approach would be to use >>> InvalidSnapshot, which I think would be OK too if people dislike this >>> approach. >> >> FWIW, I think using InvalidSnapshot would be preferable to introducing >> a new concept for what's pretty much the same thing. > > Andres voted the other way on the previous thread. I'll wait and see > if there are any other opinions. The SnapshotError concept seemed > attractive to me initially, but I'm not as excited about it after > seeing how it turned out, so maybe it's best to do it as you suggest. > >>> With that done, the only remaining uses of SnapshotNow in our code >>> base will be in currtid_byreloid() and currtid_byrelname(). So far no >>> one on this list has been able to understand clearly what the purpose >>> of those functions is, so I'm copying this email to pgsql-odbc in case >>> someone there can provide more insight. >> >> I had the idea they were used for a client-side implementation of WHERE >> CURRENT OF. Perhaps that's dead code and could be removed entirely? > > It's been reported that ODBC still uses them. Though PostgreSQL's TID is similar to Orale's ROWID, it is transient and changed after update operations unfortunately. I implemented the currtid_xx functions to supplement the difference. For example currtid(relname, original tid) (hopefully) returns the current tid of the original row when it is updated. regards, Hiroshi Inoue -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc