Re: pg_get_indexdef() modification to use TxnSnapshot - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_get_indexdef() modification to use TxnSnapshot
Date
Msg-id 2869995.1696561880@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_get_indexdef() modification to use TxnSnapshot  (kuroda.keisuke@nttcom.co.jp)
Responses Re: pg_get_indexdef() modification to use TxnSnapshot
List pgsql-hackers
kuroda.keisuke@nttcom.co.jp writes:
> On 2023-06-14 15:31, vignesh C wrote:
>> I have attempted to convert pg_get_indexdef() to use
>> systable_beginscan() based on transaction-snapshot rather than using
>> SearchSysCache().

Has anybody thought about the fact that ALTER TABLE ALTER TYPE
(specifically RememberIndexForRebuilding) absolutely requires seeing
the latest version of the index's definition?

>>> it would be going to be a large refactoring and potentially make the
>>> future implementations such as pg_get_tabledef() etc hard. Have you
>>> considered changes to the SearchSysCache() family so that they
>>> internally use a transaction snapshot that is registered in advance.

A very significant fraction of other SearchSysCache callers likewise
cannot afford to see stale data.  We might be able to fix things so
that the SQL-accessible ruleutils functionality works differently, but
we can't just up and change the behavior of cache lookups everywhere.

            regards, tom lane



pgsql-hackers by date:

Previous
From: kuroda.keisuke@nttcom.co.jp
Date:
Subject: Re: pg_get_indexdef() modification to use TxnSnapshot
Next
From: Dilip Kumar
Date:
Subject: Re: Opportunistically pruning page before update