Commit c2ff42c6 authored by Peter Eisentraut's avatar Peter Eisentraut

Error message improvement

parent 3486bcf9
...@@ -1369,7 +1369,7 @@ ExecuteTruncate(TruncateStmt *stmt) ...@@ -1369,7 +1369,7 @@ ExecuteTruncate(TruncateStmt *stmt)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE), (errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot truncate only a partitioned table"), errmsg("cannot truncate only a partitioned table"),
errhint("Do not specify the ONLY keyword, or use truncate only on the partitions directly."))); errhint("Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.")));
} }
/* /*
......
...@@ -455,12 +455,12 @@ CREATE TABLE truncparted (a int, b char) PARTITION BY LIST (a); ...@@ -455,12 +455,12 @@ CREATE TABLE truncparted (a int, b char) PARTITION BY LIST (a);
-- error, can't truncate a partitioned table -- error, can't truncate a partitioned table
TRUNCATE ONLY truncparted; TRUNCATE ONLY truncparted;
ERROR: cannot truncate only a partitioned table ERROR: cannot truncate only a partitioned table
HINT: Do not specify the ONLY keyword, or use truncate only on the partitions directly. HINT: Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1); CREATE TABLE truncparted1 PARTITION OF truncparted FOR VALUES IN (1);
INSERT INTO truncparted VALUES (1, 'a'); INSERT INTO truncparted VALUES (1, 'a');
-- error, must truncate partitions -- error, must truncate partitions
TRUNCATE ONLY truncparted; TRUNCATE ONLY truncparted;
ERROR: cannot truncate only a partitioned table ERROR: cannot truncate only a partitioned table
HINT: Do not specify the ONLY keyword, or use truncate only on the partitions directly. HINT: Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
TRUNCATE truncparted; TRUNCATE truncparted;
DROP TABLE truncparted; DROP TABLE truncparted;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment