Re: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update' - Mailing list pgsql-bugs

From Martin Pitt
Subject Re: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update'
Date
Msg-id 20070206181428.GP9481@piware.de
Whole thread Raw
In response to Re: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi Tom,

Tom Lane [2007-02-06 11:25 -0500]:
> "Martin Pitt" <martin@piware.de> writes:
> > db> create table foo (bar VARCHAR(20) NOT NULL check (bar in
> > ('FOO','BAR')));
> > CREATE TABLE
>=20
> > db> insert into foo (bar) values ('FOO');
> > INSERT 0 1
>=20
> > db> update foo set bar =3D 'BAR';
> > ERROR: attribute 1 has wrong type
> > DETAIL: Table has type character varying, but query expects character v=
arying.
>=20
> Sigh.  The trouble with security patches is that by nature they can't
> get very wide testing :-(.  I think we shall have to do something like
> the attached.  Arguably this problem is exposing bugs elsewhere in the
> system, but for now ExecEvalVar() is going to have to be less
> aggressive.

I confirm that this patch fixes the problem.

Thanks for the fast reaction!

Martin
--=20
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: Re: Strange "Table has type character varying, but query expects character varying" errors
Next
From: Tom Lane
Date:
Subject: Re: 8.2.2 regression with indices on user functions, 8.2.1 works