The attached patch cleans up the implementation of the TRUNCATE command;
Bruce Momjian <bruce@momjian.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +2 −2 |
| src/backend/commands/creatinh.c | modified | +30 −5 |
| src/backend/tcop/utility.c | modified | +3 −24 |
| src/include/catalog/heap.h | modified | +2 −2 |
| src/include/commands/creatinh.h | modified | +3 −3 |