diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-25 04:06:58 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-25 04:06:58 +0000 |
commit | e093dcdd2853911ca1ad710581182dfcb6c78ea3 (patch) | |
tree | 59fc44746f9937abea6ad44e2098a8c3c4b7f7e6 /src/backend/tcop/utility.c | |
parent | 8f91e2b6071aaeae333f668d0f5d9189c5710a7a (diff) | |
download | postgresql-e093dcdd2853911ca1ad710581182dfcb6c78ea3.tar.gz postgresql-e093dcdd2853911ca1ad710581182dfcb6c78ea3.zip |
Add the ability to create indexes 'concurrently', that is, without
blocking concurrent writes to the table. Greg Stark, with a little help
from Tom Lane.
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index ce86a90ba3f..781026b3237 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.266 2006/08/15 18:26:58 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.267 2006/08/25 04:06:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -781,6 +781,9 @@ ProcessUtility(Node *parsetree, { IndexStmt *stmt = (IndexStmt *) parsetree; + if (stmt->concurrent) + PreventTransactionChain(stmt, "CREATE INDEX CONCURRENTLY"); + CheckRelationOwnership(stmt->relation, true); DefineIndex(stmt->relation, /* relation */ @@ -795,10 +798,11 @@ ProcessUtility(Node *parsetree, stmt->unique, stmt->primary, stmt->isconstraint, - false, /* is_alter_table */ - true, /* check_rights */ - false, /* skip_build */ - false); /* quiet */ + false, /* is_alter_table */ + true, /* check_rights */ + false, /* skip_build */ + false, /* quiet */ + stmt->concurrent); /* concurrent */ } break; |