Re: pg_get_indexdef() modification to use TxnSnapshot

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: kuroda(dot)keisuke(at)nttcom(dot)co(dot)jp, vignesh C <vignesh21(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_get_indexdef() modification to use TxnSnapshot
Date: 2024-01-05 17:49:29
Message-ID: CA+TgmobiBg10QsxzSm+HdhwjJ6KG-HV89EMkeLcNjnF64tUZ-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 5, 2023 at 11:15 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> kuroda(dot)keisuke(at)nttcom(dot)co(dot)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.

This patch was registered in the CommitFest as a bug fix, but I think
it's a much more significant change than that label applies, and it
seems like we have no consensus on what the right design is.

Since there's been no response to these (entirely valid) comments from
Tom in the past 3 months, I've marked this CF entry RwF for now.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-01-05 17:56:49 Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Previous Message Eric Hanson 2024-01-05 17:48:03 Re: SET ROLE x NO RESET