aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-03-19 02:58:20 +0000
committerBruce Momjian <bruce@momjian.us>2002-03-19 02:58:20 +0000
commita9819ca253ba13f07a6c4433ef5ecd94c007a716 (patch)
tree9c4d6695aaedaafe7927b6cfcadd7ac4ef66c87f /src/include
parentd8e70cd829c517890fd35de74d2654e5bdaf201b (diff)
downloadpostgresql-a9819ca253ba13f07a6c4433ef5ecd94c007a716.tar.gz
postgresql-a9819ca253ba13f07a6c4433ef5ecd94c007a716.zip
The attached patch cleans up the implementation of the TRUNCATE command;
in the current code, the authentication logic (check user, check the relation we're operating on, etc) is done in tcop/utility.c, whereas the actual TRUNCATE command in done in TruncateRelation() in commands/createinh.c (which is really just a wrapper over heap_truncate() in catalog/heap.c). This patch moves the authentication logic into TruncateRelation(), as well as making some minor code cleanups. Neil Conway
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/heap.h4
-rw-r--r--src/include/commands/creatinh.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 368293148bb..4298f53bdc4 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: heap.h,v 1.44 2002/03/19 02:18:22 momjian Exp $
+ * $Id: heap.h,v 1.45 2002/03/19 02:58:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,7 +41,7 @@ extern Oid heap_create_with_catalog(char *relname, TupleDesc tupdesc,
extern void heap_drop_with_catalog(const char *relname,
bool allow_system_table_mods);
-extern void heap_truncate(char *relname);
+extern void heap_truncate(const char *relname);
extern void AddRelationRawConstraints(Relation rel,
List *rawColDefaults,
diff --git a/src/include/commands/creatinh.h b/src/include/commands/creatinh.h
index e676fc25939..4cc9801e85e 100644
--- a/src/include/commands/creatinh.h
+++ b/src/include/commands/creatinh.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: creatinh.h,v 1.17 2001/11/05 17:46:33 momjian Exp $
+ * $Id: creatinh.h,v 1.18 2002/03/19 02:58:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,7 +17,7 @@
#include "nodes/parsenodes.h"
extern void DefineRelation(CreateStmt *stmt, char relkind);
-extern void RemoveRelation(char *name);
-extern void TruncateRelation(char *name);
+extern void RemoveRelation(const char *name);
+extern void TruncateRelation(const char *name);
#endif /* CREATINH_H */