On Mon, Jul 20, 2009 at 10:09 AM, Alvaro Herrera<alvhe...@commandprompt.com> wrote: > Tom Lane escribió: >> Jaime Casanova <jcasa...@systemguards.com.ec> writes: >> > this one applies, compiles and it actually fixes the bug... >> >> And introduces a bunch of new ones. Surely you don't think that version >> of compatible_tupdesc() is good enough. > > Getting rid of the check on natts was "ungood" ... it needs to compare > the number of undropped columns of both tupdescs. >
ah! ok, i see... i will mark the patch as "waiting on author" and then will try to fix it myself unless pavel wants to do it himself create table test_tbl (a int, b date, c int); create function trg_ins_test_tbl() returns trigger as $$ begin new.c = 100; return new; end; $$ language plpgsql; create trigger trg_test_tbl before insert on test_tbl for each row execute procedure trg_ins_test_tbl(); insert into test_tbl(a, b) select i, current_date + i from generate_series(7, 9) as i; alter table test_tbl add column z text; alter table test_tbl drop column z; alter table test_tbl add column z text; insert into test_tbl(a, b) select i, current_date + i from generate_series(7, 9) as i; ERROR: returned row structure does not match the structure of the triggering table DETAIL: Returned type text does not match expected type text in column "z". CONTEXT: PL/pgSQL function "trg_ins_test_tbl" during function exit STATEMENT: insert into test_tbl(a, b) select i, current_date + i from generate_series(7, 9) as i; -- Atentamente, Jaime Casanova Soporte y capacitación de PostgreSQL Asesoría y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs