Diffrent column ordering after dump/restore tables with INHERITS

From: Oleg Serov <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Diffrent column ordering after dump/restore tables with INHERITS
Date: 2009-07-04 20:10:55
Message-ID: cec7c6df0907041310g6f408873je542d8b50bede065@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

If i have tables with inherits, and the
n i adding a column in to the base table, the new column will be at
the on of column list in child table, but when i done dump->restore i
have surprise,
Column ordering was changed.
Some example:

CREATE TABLE test_base (
id INT
);
CREATE TABLE test_child_with_data (
t TEXT
) INHERITS (test_base);

ALTER TABLE test_base ADD COLUMN date DATE;

INSERT INTO test_child_with_data
SELECT 1, 'test', NOW(); -- works fine.

-- Dump/restore

INSERT INTO test_child_with_data
SELECT 1, 'test', NOW(); -- error..

So, column ordering after dump, restore must be the same!
I don't know how to live with it, now i have on production-server
small db, and i can use dump/restore. but on other project
dump/restore takes 8 hours.. so, any ideas ?
More detailed how i use it
in one procedure
INSERT INTO test_child_with_data
SELECT select_procedure();

select_procedure:
...
SELECT 1, 'test', NOW()
FROM...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Headland 2009-07-05 01:03:00 BUG #4899: Open parenthesis breaks query plan
Previous Message Michal Szymanski 2009-07-03 10:57:40 RETURN QUERY still does not work perfect in Postgres 8.4