WaitForOlderSnapshots refactoring - Mailing list pgsql-hackers

From Peter Eisentraut
Subject WaitForOlderSnapshots refactoring
Date
Msg-id 8d56e394-3ce3-a327-9245-7795004984db@2ndquadrant.com
Whole thread Raw
Responses Re: WaitForOlderSnapshots refactoring
List 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

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: TupleTableSlot abstraction
Next
From: Peter Eisentraut
Date:
Subject: Re: ALTER TABLE on system catalogs