WaitForOlderSnapshots refactoring

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: WaitForOlderSnapshots refactoring
Date: 2018-08-20 12:35:34
Message-ID: 8d56e394-3ce3-a327-9245-7795004984db@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch factors out the CREATE INDEX CONCURRENTLY code that
waits for transactions with older snapshots to finish into a new
function WaitForOlderSnapshots().

This refactoring was part of a previously posted REINDEX CONCURRENTLY
patch. But this code is now also appearing as a copy-and-paste in the
ATTACH/DETACH PARTITION CONCURRENTLY thread, so it might be worth making
it an official thing.

The question is where to put it. This patch just leaves it static in
indexcmds.c, which doesn't help other uses. A sensible place might be a
new src/backend/commands/common.c. Or we make it non-static in
indexcmds.c when the need arises.

Thoughts?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Factor-out-WaitForOlderSnapshots.patch text/plain 7.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-08-20 12:38:25 Re: ALTER TABLE on system catalogs
Previous Message Andres Freund 2018-08-20 12:28:22 Re: TupleTableSlot abstraction