Re: Documentation improvements for partitioning

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Documentation improvements for partitioning
Date: 2017-02-19 16:03:52
Message-ID: CA+TgmoYkUvMONhjC=738-MSkwx86DwZLr-gqvXq8WU+3hBCLFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 16, 2017 at 7:15 AM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> I think 0001 is better than the status quo, but I'm wondering whether
>> we should try to do something slightly different. Maybe it should
>> always work for the child table to specify neither WITH OIDS nor
>> WITHOUT OIDS, but if you do specify one of them then it has to be the
>> one that matches the parent partitioned table? With this patch, IIUC,
>> WITH OIDS is allowed only if the parent has the same, but WITHOUT OIDS
>> is allowed (but ignored) regardless of the parent setting.
>
> With the patch, one can always specify (or not) WITH/WITHOUT OIDS when
> creating partitions. If WITH OIDS is specified and the parent doesn't
> have OIDs, then an error is raised. Then just like with normal
> inheritance, WITHOUT OIDS specification for a partition will be
> *overridden* if the parent has OIDs. By the way, CREATE TABLE page says
> this about inheritance and OIDS:
>
> (If the new table inherits from any tables that have OIDs, then
> <literal>OIDS=TRUE</> is forced even if the command says
> <literal>OIDS=FALSE</>.
>
> Hopefully it's clear to someone reading "If the table inherits from any
> tables ..." that it also refers to creating partition of a partitioned table.

I rewrote this to be a bit more explicit and committed it. I noticed
that there was some duplication here: the old text said both this:

A partition cannot have columns other than those inherited from the parent.

And also this just a little later in the same page:

A partition must have the same column names and types as the table of
which it is a partition.

The second wording seemed better, so I moved that statement a little
higher up and rejiggered the wording to be super-clear about OIDs.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-02-19 16:04:42 Re: Documentation improvements for partitioning
Previous Message Tom Lane 2017-02-19 15:49:29 Re: Replication vs. float timestamps is a disaster