Re: BUG #3847: plpython trigger caches table structure - doesn't see new / changed columns - Mailing list pgsql-bugs

From Mark Reid
Subject Re: BUG #3847: plpython trigger caches table structure - doesn't see new / changed columns
Date
Msg-id 162057b00801011542k7bb8679fif4b072659ce981df@mail.gmail.com
Whole thread Raw
In response to Re: BUG #3847: plpython trigger caches table structure - doesn't see new / changed columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #3847: plpython trigger caches table structure - doesn't see new / changed columns
List pgsql-bugs
The trigger function does not recognize the "test4" column the second time
it is added - the update throws an error.

On Jan 1, 2008 11:17 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "Mark Reid" <reid.write@gmail.com> writes:
> > If a column is added, dropped, then re-added (all within a transaction),
> a
> > plpython trigger function loses track of the column and throws an error
> when
> > trying to access it.  Here is the best minimal test case I could come up
> > with:
>
> The cases you are saying work and don't work are exactly the same:
>
> > -- This works
> > alter table clarence add column test4 varchar;
> > update clarence set test4=12 where pick_id=1454;
> > alter table clarence drop column test4;
>
> > -- This does not work
> > alter table clarence add column test4 varchar;
> > update clarence set test4=12 where pick_id=1454; -- this creates a
> > problem...  plpgsql seems to work fine.
> > alter table clarence drop column test4;
>
> Please be clearer.
>
>                        regards, tom lane
>

pgsql-bugs by date:

Previous
From: Sam Mason
Date:
Subject: Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #3822: Nonstandard precedence for comparison operators