Re: different column orders in regression test database

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: different column orders in regression test database
Date: 2017-05-18 23:11:15
Message-ID: 20170518231115.q2i27lk3zgx6qk7v@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On 5/18/17 16:21, Thomas Munro wrote:
> > That's because if you attach a partition with a different column
> > ordering,
>
> Is it intentional and sensible to allow that in the first place? Or was
> it just inherited from inheritance?

I think it was deliberately allowed. Note that if you have a table with
dropped columns which you want to make a partition of another table
without them, there will need to be some physical transformation of
the tuples anyway in order for reading to work; we certainly don't want
to reject such cases.

> > pg_dump dumps it with a normal CREATE TABLE ... PARTITION OF
> > ... command, so the ordering it lost.
>
> So it appears that either the above should be prohibited or pg_dump
> should be fixed.

Are you proposing that if the ordering of the columns of a partition is
not identical to that of its parent table, the partition should be
dumped as a regular CREATE TABLE followed by ALTER TABLE .. ATTACH PARTITION,
instead of a single CREATE TABLE .. PARTITION OF command?

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2017-05-18 23:24:41 Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Previous Message Thomas Munro 2017-05-18 23:07:59 Re: different column orders in regression test database