On 17-09-2015 14:21, Michael Paquier wrote:
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".
pg_dump relies on attnum to define the column ordering, so one
possibility would be to do things more consistently at backend level.
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
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  about logical column
ordering seems to have died a few months ago. Alvaro?
Euler Taveira Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: