Re: Adding support for Default partition in partitioning

From: Keith Fiske <keith(at)omniti(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding support for Default partition in partitioning
Date: 2017-03-07 16:30:59
Message-ID: CAG1_KcAW6u=EH0RiXZZ9h5eMCuZQQRQ8jejwAq2pN1TfzK9n0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 2, 2017 at 9:40 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Wed, Mar 1, 2017 at 6:29 AM, Rahila Syed <rahilasyed90(at)gmail(dot)com>
> wrote:
> > 3. Handling adding a new partition to a partitioned table
> > with default partition.
> > This will require moving tuples from existing default partition to
> > newly created partition if they satisfy its partition bound.
>
> Considering that this patch was submitted at the last minute and isn't
> even complete, I can't see this getting into v10. But that doesn't
> mean we can't talk about it. I'm curious to hear other opinions on
> whether we should have this feature. On the point mentioned above, I
> don't think adding a partition should move tuples, necessarily; seems
> like it would be good enough - maybe better - for it to fail if there
> are any that would need to be moved.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

I'm all for this feature and had suggested it back in the original thread
to add partitioning to 10. I agree that adding a new partition should not
move any data out of the default. It's easy enough to set up a monitor to
watch for data existing in the default. Perhaps also adding a column to
pg_partitioned_table that contains the oid of the default partition so it's
easier to identify from a system catalog perspective and make that
monitoring easier. I don't even see a need for it to fail either and not
quite sure how that would even work? If they can't add a necessary child
due to data being in the default, how can they ever get it out? Just leave
it to the user to keep an eye on the default and fix it as necessary. This
is what I do in pg_partman.

--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, Inc.
http://www.keithf4.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-03-07 16:34:52 Re: WARNING: relcache reference leak: relation "p1" not closed
Previous Message Dilip Kumar 2017-03-07 16:27:36 Re: Parallel bitmap heap scan