1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-22 02:52:08 +03:00

Allow CREATE INDEX CONCURRENTLY to disregard transactions in other

databases, per gripe from hubert depesz lubaczewski.  Patch from
Simon Riggs.
This commit is contained in:
Tom Lane
2007-09-07 00:58:57 +00:00
parent f8942f4a15
commit cd1aae5864
4 changed files with 33 additions and 24 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.163 2007/09/05 18:10:47 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.164 2007/09/07 00:58:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -535,10 +535,12 @@ DefineIndex(RangeVar *heapRelation,
*
* We can exclude any running transactions that have xmin >= the xmax of
* our reference snapshot, since they are clearly not interested in any
* missing older tuples. Also, GetCurrentVirtualXIDs never reports our
* own vxid, so we need not check for that.
* missing older tuples. Transactions in other DBs aren't a problem
* either, since they'll never even be able to see this index.
* Also, GetCurrentVirtualXIDs never reports our own vxid, so we
* need not check for that.
*/
old_snapshots = GetCurrentVirtualXIDs(ActiveSnapshot->xmax);
old_snapshots = GetCurrentVirtualXIDs(ActiveSnapshot->xmax, false);
while (VirtualTransactionIdIsValid(*old_snapshots))
{