Add comment on no default partition with hash partitioning

Discussion: https://postgr.es/m/20190806222735.GA9535@alvherre.pgsql
This commit is contained in:
Alvaro Herrera 2019-08-07 12:27:47 -04:00
parent 4e85642d93
commit 12afc7145c
1 changed files with 6 additions and 0 deletions

View File

@ -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),