1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

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
This commit is contained in:
Bruce Momjian
2002-03-19 02:58:20 +00:00
parent d8e70cd829
commit a9819ca253
5 changed files with 40 additions and 36 deletions

View File

@@ -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 */