Skip to content

Commit 12afc71

Browse files
committed
Add comment on no default partition with hash partitioning
Discussion: https://postgr.es/m/[email protected]
1 parent 4e85642 commit 12afc71

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/parser/parse_utilcmd.c

+6
Original file line numberDiff line numberDiff line change
@@ -3727,6 +3727,12 @@ transformPartitionBound(ParseState *pstate, Relation parent,
37273727

37283728
if (spec->is_default)
37293729
{
3730+
/*
3731+
* Hash partitioning does not support a default partition; there's no
3732+
* use case for it (since the set of partitions to create is perfectly
3733+
* defined), and if users do get into it accidentally, it's hard to
3734+
* back out from it afterwards.
3735+
*/
37303736
if (strategy == PARTITION_STRATEGY_HASH)
37313737
ereport(ERROR,
37323738
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),

0 commit comments

Comments
 (0)