pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: no default hash partition
Date: Tue, 6 Aug 2019 18:27:35 -0400
Message-ID: <20190806222735.GA9535@alvherre.pgsql> (raw)

Given the discussion starting at
https://postgr.es/m/CAFjFpRdBiQjZm8sG9+s0x8Re-afHds6MFLgGuw0wVUNLGrVOQg@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

Attachments:

0001-Add-comment-on-no-default-partition-with-hash-partit.patch (text/x-diff, 907B) download From f1f5ceb124b8662f63bebc6808bcf0472b579eaa Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvherre@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

view thread (23+ messages)  latest in thread

Message-ID: <20190806222735.GA9535@alvherre.pgsql>
Permalink:  ../20190806222735.GA9535@alvherre.pgsql/
Also on:    postgresql.org/message-id/20190806222735.GA9535@alvherre.pgsql

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com
  Subject: Re: no default hash partition
  In-Reply-To: <20190806222735.GA9535@alvherre.pgsql>
  References: <20190806222735.GA9535@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox