pg_get_indexdef() modification to use TxnSnapshot

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_get_indexdef() modification to use TxnSnapshot
Date: 2023-05-26 09:54:42
Message-ID: CAJpy0uBvAyGOEHGiZMCC+oCugi-4m4EJep-e_YR3uViChOBCfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have attempted to convert pg_get_indexdef() to use
systable_beginscan() based on transaction-snapshot rather than using
SearchSysCache(). The latter does not have any old info and thus
provides only the latest info as per the committed txns, which could
result in errors in some scenarios. One such case is mentioned atop
pg_dump.c. The patch is an attempt to fix the same pg_dump's issue.
Any feedback is welcome.

There is a long list of pg_get_* functions which use SearchSysCache()
and thus may expose similar issues. I can give it a try to review the
possibility of converting all of them. Thoughts?

thanks
Shveta

Attachment Content-Type Size
v1-0001-pg_get_indexdef-modification-to-use-TxnSnapshot.patch application/octet-stream 7.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2023-05-26 10:14:29 Re: pg_get_indexdef() modification to use TxnSnapshot
Previous Message Alvaro Herrera 2023-05-26 08:56:53 Re: Cleaning up nbtree after logical decoding on standby work