Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c2ff42c6
Commit
c2ff42c6
authored
Feb 20, 2018
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error message improvement
parent
3486bcf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+1
-1
src/test/regress/expected/truncate.out
src/test/regress/expected/truncate.out
+2
-2
No files found.
src/backend/commands/tablecmds.c
View file @
c2ff42c6
...
@@ -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."
)));
}
}
/*
/*
...
...
src/test/regress/expected/truncate.out
View file @
c2ff42c6
...
@@ -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;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment