Re: Improving test coverage of extensions with pg_dump

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving test coverage of extensions with pg_dump
Date: 2015-09-20 13:30:47
Message-ID: 55FEB507.40901@timbira.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17-09-2015 14:21, Michael Paquier wrote:
> pg_dump relies on attnum to define the column ordering, so one
> possibility would be to do things more consistently at backend level.
> Thoughts?
>
According to your example, problem is the columns from the parent table
"aa" are added _before_ declaring the inherited table "bb". Then, an
attnum from column "d" (part of parent table "aa") is assigned to a
lower number than in the original table "bb".

Someone can say that we could assign an attnum for column "d"
considering all of the inheritance tree. However, attnum is used as an
index to arrays (we could bloat some of those) and some logic rely on it
to count the number of columns. It would become tablecmds.c into an
spaghetti.

IMHO a possible way to solve it is adding support for logical column
ordering. An ALTER TABLE command (emitted if a parameter was informed)
during dump could handle it. BTW, last thread [1] about logical column
ordering seems to have died a few months ago. Alvaro?

[1]
http://www.postgresql.org/message-id/20141209174146.GP1768@alvh.no-ip.org

--
Euler Taveira Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2015-09-20 13:36:22 Re: A better translation version of Chinese forpsql/po/zh_CN.po file
Previous Message Xiong He 2015-09-20 13:06:48 Re: A better translation version of Chinese forpsql/po/zh_CN.po file