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...