Re: Adding support for Default partition in partitioning

From: "Sven R(dot) Kunze" <srkunze(at)mail(dot)de>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>, amul sul <sulamul(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Keith Fiske <keith(at)omniti(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding support for Default partition in partitioning
Date: 2017-05-04 20:40:17
Message-ID: b616f64a-3197-dac3-19cd-4c16a758a51e@mail.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Rahila,

still thinking about the syntax (sorry):

On 04.05.2017 13:44, Rahila Syed wrote:
> [...] The syntax implemented in this patch is as follows,
>
> CREATE TABLE p11 PARTITION OF p1 DEFAULT;

Rewriting the following:

> On Thu, May 4, 2017 at 4:02 PM, amul sul <sulamul(at)gmail(dot)com
> <mailto:sulamul(at)gmail(dot)com>> wrote:
>
> [...] CREATE TABLE p1 PARTITION OF test FOR VALUES IN (DEFAULT)
> PARTITION BY LIST(b); [...]
>

It yields

CREATE TABLE p1 PARTITION OF test DEFAULT PARTITION BY LIST(b);

This reads to me like "DEFAULT PARTITION".

I can imagine a lot of confusion when those queries are encountered in
the wild. I know this thread is about creating a default partition but I
were to propose a minor change in the following direction, I think
confusion would be greatly avoided:

CREATE TABLE p1 PARTITION OF test*AS *DEFAULT PARTITION*ED* BY LIST(b);

I know it's a bit longer but I think those 4 characters might serve
readability in the long term. It was especially confusing to see
PARTITION in two positions serving two different functions.

Sven

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-05-04 20:56:56 Re: PG 10 release notes
Previous Message Thomas Munro 2017-05-04 20:29:38 Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)