aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-08-07 12:27:47 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-08-07 12:27:47 -0400
commit12afc7145c03c212f26fea3a99e016da6a1c919c (patch)
treec6d40c3bd9a4403eeb30ce9328a8bdcbd0495a97 /src/backend/parser/parse_utilcmd.c
parent4e85642d935eb13341584df7776eb76585d45819 (diff)
downloadpostgresql-12afc7145c03c212f26fea3a99e016da6a1c919c.tar.gz
postgresql-12afc7145c03c212f26fea3a99e016da6a1c919c.zip
Add comment on no default partition with hash partitioning
Discussion: https://postgr.es/m/20190806222735.GA9535@alvherre.pgsql
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r--src/backend/parser/parse_utilcmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index a9b2f8bacd8..6e5768c66cf 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -3727,6 +3727,12 @@ transformPartitionBound(ParseState *pstate, Relation parent,
if (spec->is_default)
{
+ /*
+ * Hash partitioning does not support a default partition; there's no
+ * use case for it (since the set of partitions to create is perfectly
+ * defined), and if users do get into it accidentally, it's hard to
+ * back out from it afterwards.
+ */
if (strategy == PARTITION_STRATEGY_HASH)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),