summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Haas2011-07-18 15:02:48 +0000
committerRobert Haas2011-07-18 15:04:43 +0000
commit367bc426a1c22b9f6badb06cd41fc438fd034639 (patch)
treeeb518f0e9399e0857f0e5f79c10750e1bfdaf909 /src/include
parent8f8a273c4d2433de57f6f0356f44ab47b7387641 (diff)
Avoid index rebuild for no-rewrite ALTER TABLE .. ALTER TYPE.
Noah Misch. Review and minor cosmetic changes by me.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/heap.h1
-rw-r--r--src/include/catalog/index.h1
-rw-r--r--src/include/catalog/storage.h2
-rw-r--r--src/include/commands/defrem.h8
-rw-r--r--src/include/nodes/parsenodes.h1
-rw-r--r--src/include/utils/relcache.h1
6 files changed, 12 insertions, 2 deletions
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 0b7b190dd10..aee2d88ebe2 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -39,6 +39,7 @@ extern Relation heap_create(const char *relname,
Oid relnamespace,
Oid reltablespace,
Oid relid,
+ Oid relfilenode,
TupleDesc tupDesc,
char relkind,
char relpersistence,
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 071db7f4012..8b78b05a2e6 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -35,6 +35,7 @@ extern void index_check_primary_key(Relation heapRel,
extern Oid index_create(Relation heapRelation,
const char *indexRelationName,
Oid indexRelationId,
+ Oid relFileNode,
IndexInfo *indexInfo,
List *indexColNames,
Oid accessMethodObjectId,
diff --git a/src/include/catalog/storage.h b/src/include/catalog/storage.h
index 8dee8cf2251..6907d836708 100644
--- a/src/include/catalog/storage.h
+++ b/src/include/catalog/storage.h
@@ -22,7 +22,7 @@
extern void RelationCreateStorage(RelFileNode rnode, char relpersistence);
extern void RelationDropStorage(Relation rel);
-extern void RelationPreserveStorage(RelFileNode rnode);
+extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit);
extern void RelationTruncate(Relation rel, BlockNumber nblocks);
/*
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h
index bbc024f50cc..81c515ebed3 100644
--- a/src/include/commands/defrem.h
+++ b/src/include/commands/defrem.h
@@ -18,9 +18,10 @@
/* commands/indexcmds.c */
-extern void DefineIndex(RangeVar *heapRelation,
+extern Oid DefineIndex(RangeVar *heapRelation,
char *indexRelationName,
Oid indexRelationId,
+ Oid relFileNode,
char *accessMethodName,
char *tableSpaceName,
List *attributeList,
@@ -49,6 +50,11 @@ extern char *ChooseIndexName(const char *tabname, Oid namespaceId,
List *colnames, List *exclusionOpNames,
bool primary, bool isconstraint);
extern List *ChooseIndexColumnNames(List *indexElems);
+extern bool CheckIndexCompatible(Oid oldId,
+ RangeVar *heapRelation,
+ char *accessMethodName,
+ List *attributeList,
+ List *exclusionOpNames);
extern Oid GetDefaultOpClass(Oid type_id, Oid am_id);
/* commands/functioncmds.c */
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 00c1269bd14..92e40d3fb58 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -2062,6 +2062,7 @@ typedef struct IndexStmt
Node *whereClause; /* qualification (partial-index predicate) */
List *excludeOpNames; /* exclusion operator names, or NIL if none */
Oid indexOid; /* OID of an existing index, if any */
+ Oid oldNode; /* relfilenode of my former self */
bool unique; /* is index unique? */
bool primary; /* is index on primary key? */
bool isconstraint; /* is it from a CONSTRAINT clause? */
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index 1f4def56845..ef1692cfa84 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -67,6 +67,7 @@ extern Relation RelationBuildLocalRelation(const char *relname,
Oid relnamespace,
TupleDesc tupDesc,
Oid relid,
+ Oid relfilenode,
Oid reltablespace,
bool shared_relation,
bool mapped_relation,