Given the discussion starting at https://postgr.es/m/cafjfprdbiqjzm8sg9+s0x8re-afhds6mflgguw0wvunlgrv...@mail.gmail.com we don't have default-partition support with the hash partitioning scheme. That seems a reasonable outcome, but I think we should have a comment about it (I had to search the reason for this restriction in the hash-partitioning patch set). How about the attached? Does anyone see a reason to make this more verbose, and if so to what?
... unless somebody wants to argue that we should have the feature; if so please share your patch. Thanks -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>From f1f5ceb124b8662f63bebc6808bcf0472b579eaa Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvhe...@alvh.no-ip.org> Date: Tue, 6 Aug 2019 12:25:56 -0400 Subject: [PATCH] Add comment on no default partition with hash partitioning --- src/backend/parser/parse_utilcmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index a9b2f8bacd..83c8048387 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -3727,6 +3727,10 @@ transformPartitionBound(ParseState *pstate, Relation parent, if (spec->is_default) { + /* + * Hash partitioning does not support a default partition; there's no + * use case for it and it's likely to cause trouble for users. + */ if (strategy == PARTITION_STRATEGY_HASH) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), -- 2.17.1