Re: Removal of currtid()/currtid2() and some table AM cleanup - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Removal of currtid()/currtid2() and some table AM cleanup
Date
Msg-id 20200623050233.GJ50978@paquier.xyz
Whole thread Raw
In response to Re: Removal of currtid()/currtid2() and some table AM cleanup  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Removal of currtid()/currtid2() and some table AM cleanup
List pgsql-hackers
On Tue, Jun 23, 2020 at 01:29:06PM +0900, Michael Paquier wrote:
> Sorry, but I am not quite sure what is the relationship between
> UseDeclareFetch and currtid2()?  Is that related to the use of
> SQL_CURSOR_KEYSET_DRIVEN?  The only thing I can be sure of here is
> that we never call currtid2() in any of the regression tests present
> in the ODBC code for any of the scenarios covered by installcheck-all,
> so that does not really bring any confidence that removing currtid2()
> is a wise thing to do, because we may silently break stuff.  If the
> function is used, it would be good to close the gap with a test to
> stress that at least in the driver.

Actually, while reviewing the code, the only code path where we use
currtid2() involves positioned_load() and LATEST_TUPLE_LOAD.  And the
only location where this happens is in SC_pos_reload_with_key(), where
I don't actually see how it would be possible to not have a keyset and
still use a CTID, which would led to LATEST_TUPLE_LOAD being used.  So
could it be possible that the code paths of currtid2() are actually
just dead code?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Eric Ridge
Date:
Subject: Re: Threading in BGWorkers (!)
Next
From: Amit Kapila
Date:
Subject: Re: Resetting spilled txn statistics in pg_stat_replication