pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Inoue, Hiroshi <inoue@tpf.co.jp>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-odbc@postgresql.org
Subject: Re: [HACKERS] getting rid of SnapshotNow
Date: Fri, 19 Jul 2013 15:03:30 +0200
Message-ID: <20130719130330.GI20525@alap2.anarazel.de> (raw)
In-Reply-To: <51E880CD.6060304@tpf.co.jp>
References: <CA+TgmoaLeu7wKtfPA0v=iQNMKOJZqg4TZf1Gyxn=7mbwa=Mxag@mail.gmail.com>
	<3461.1374158054@sss.pgh.pa.us>
	<CA+Tgmoa86bLQL6YqvSkHGa5pByvMAL7dxY+ZN_GiMh+goP9qfA@mail.gmail.com>
	<51E880CD.6060304@tpf.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

On 2013-07-19 08:57:01 +0900, Inoue, Hiroshi wrote:
> >>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.

That is only guaranteed to work though when you're in a transaction old
enough to prevent removal of the old or intermediate row versions. E.g.
BEGIN;
INSERT INTO foo...; -- last tid (0, 1)
COMMIT;
BEGIN;
SELECT currtid(foo, '(0, 1'));
COMMIT;

can basically return no or even an arbitrarily different row. Same with
an update...

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (44+ messages)  latest in thread

Message-ID: <20130719130330.GI20525@alap2.anarazel.de>
Permalink:  ../20130719130330.GI20525@alap2.anarazel.de/
Also on:    postgresql.org/message-id/20130719130330.GI20525@alap2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: andres@2ndquadrant.com, inoue@tpf.co.jp, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] getting rid of SnapshotNow
  In-Reply-To: <20130719130330.GI20525@alap2.anarazel.de>
  References: <CA+TgmoaLeu7wKtfPA0v=iQNMKOJZqg4TZf1Gyxn=7mbwa=Mxag@mail.gmail.com> <3461.1374158054@sss.pgh.pa.us> <CA+Tgmoa86bLQL6YqvSkHGa5pByvMAL7dxY+ZN_GiMh+goP9qfA@mail.gmail.com> <51E880CD.6060304@tpf.co.jp> <20130719130330.GI20525@alap2.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox