Skip site navigation (1) Skip section navigation (2)

Re: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update'

From: Martin Pitt <martin(at)piware(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update'
Date: 2007-02-06 18:14:28
Message-ID: 20070206181428.GP9481@piware.de (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi Tom,

Tom Lane [2007-02-06 11:25 -0500]:
> "Martin Pitt" <martin(at)piware(dot)de> writes:
> > db> create table foo (bar VARCHAR(20) NOT NULL check (bar in
> > ('FOO','BAR')));
> > CREATE TABLE
> 
> > db> insert into foo (bar) values ('FOO');
> > INSERT 0 1
> 
> > db> update foo set bar = 'BAR';
> > ERROR: attribute 1 has wrong type
> > DETAIL: Table has type character varying, but query expects character varying.
> 
> 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
-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

In response to

pgsql-bugs by date

Next:From: ThomasDate: 2007-02-06 20:10:52
Subject: BUG #2973: Compile Error with MIPSpro compiler
Previous:From: Martin PittDate: 2007-02-06 17:45:01
Subject: Re: Strange "Table has type character varying, but query expects character varying" errors

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group