Minor buglet in update...from (I think) - Mailing list pgsql-hackers

From Philip Warner
Subject Minor buglet in update...from (I think)
Date
Msg-id 3.0.5.32.20000630215746.03221df0@mail.rhyme.com.au
Whole thread Raw
Responses Re: Minor buglet in update...from (I think)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Minor buglet in update...from (I think)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Minor buglet in update...from (I think)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
A minor nasty error I got when trying to improve the query used to disable
triggers:

create table t1(f1 int4, f2 int4);
create table t2(f1 int4, f2 int4);

insert into t1 values(1, 0);
insert into t1 values(2, 0);

insert into t2 values(1, 0);

update t1 set f2=count(*) from t2 where t1.f1=1 and t2.f1=t1.f1 ;
UPDATE 1

update t1 set f2=count(*) from t2 where t1.f1=2 and t2.f1=t1.f1 ;
ERROR:  ExecutePlan: (junk) `ctid' is NULL!

I would have expected no update to occur since no rows match.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 008 659 498)             |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


pgsql-hackers by date:

Previous
From: Fabrizio Sciarra
Date:
Subject: PostgreSQL + Solaris + Mico + Purify = ????
Next
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: postgres - development of inet/cidr