Re: dropping partitioned tables without CASCADE

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dropping partitioned tables without CASCADE
Date: 2017-11-03 12:39:00
Message-ID: 20171103123900.7xxc532ka4o34i4a@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ashutosh Bapat wrote:
> On Fri, Nov 3, 2017 at 1:42 PM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:

> > I think adding "is partitioned" at end of line isn't good; looks like a
> > phrase but isn't translatable. Maybe add keyword PARTITIONED instead?
>
> In that case may be we should separate bounds and "PARTITIONED" with a
> ",". "part_default DEFAULT, PARTITIONED" would read better than
> "part_default DEFAULT PARTITIONED"?

Hmm, I vote +0.5 for the comma.

> > Having the DEFAULT partition show up in the middle of the list is weird.
>
> Agreed. But that's true even without this patch.

Yes.

> > Is it possible to put it at either start or end of the list?
>
> Right now, we could do that if we order the list by bound expression;
> lexically DEFAULT would come before FOR VALUES ... . But that's not
> future-safe; we may have a bound expression starting with A, B or C.
> Beyond that it really gets tricky to order the partitions by bounds.

I was just thinking in changing the query to be "order by
is_the_default_partition, partition_name" instead of just "order by
partition_name". Sorting by bounds rather than name (a feature whose
worth should definitely be discussed separately IMV) sounds a lot more
complicated.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-11-03 12:57:30 LDAP URI decoding bugs
Previous Message Michael Paquier 2017-11-03 12:34:01 Re: SQL/JSON in PostgreSQL