aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/tablecmds.h
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-07-28 05:22:24 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-07-28 05:22:24 +0000
commit2dbbda02e7e688311e161a912a0ce00cde9bb6fc (patch)
treeadf4f2ca8c477550f19bd6362d0b6fa4ae19f68b /src/include/commands/tablecmds.h
parent133924e13e004db8979424bf5436e21b0a09a069 (diff)
downloadpostgresql-2dbbda02e7e688311e161a912a0ce00cde9bb6fc.tar.gz
postgresql-2dbbda02e7e688311e161a912a0ce00cde9bb6fc.zip
Reduce lock levels of CREATE TRIGGER and some ALTER TABLE, CREATE RULE actions.
Avoid hard-coding lockmode used for many altering DDL commands, allowing easier future changes of lock levels. Implementation of initial analysis on DDL sub-commands, so that many lock levels are now at ShareUpdateExclusiveLock or ShareRowExclusiveLock, allowing certain DDL not to block reads/writes. First of number of planned changes in this area; additional docs required when full project complete.
Diffstat (limited to 'src/include/commands/tablecmds.h')
-rw-r--r--src/include/commands/tablecmds.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 45d1835548a..c94a46027ed 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.46 2010/02/01 19:28:56 rhaas Exp $
+ * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.47 2010/07/28 05:22:24 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#define TABLECMDS_H
#include "nodes/parsenodes.h"
+#include "storage/lock.h"
#include "utils/relcache.h"
@@ -24,12 +25,14 @@ extern void RemoveRelations(DropStmt *drop);
extern void AlterTable(AlterTableStmt *stmt);
-extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing);
+extern LOCKMODE AlterTableGetLockLevel(List *cmds);
+
+extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lockmode);
extern void AlterTableInternal(Oid relid, List *cmds, bool recurse);
extern void AlterTableNamespace(RangeVar *relation, const char *newschema,
- ObjectType stmttype);
+ ObjectType stmttype, LOCKMODE lockmode);
extern void AlterRelationNamespaceInternal(Relation classRel, Oid relOid,
Oid oldNspOid, Oid newNspOid,