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

Re: Minor buglet in update...from (I think)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Minor buglet in update...from (I think)
Date: 2001-11-26 20:22:55
Message-ID: 200111262022.fAQKMtj16709@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Can anyone explain this failure?  It still exists in CVS.

---------------------------------------------------------------------------

> 
> 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   |/
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Barry LindDate: 2001-11-26 21:01:37
Subject: insert/update/delete statements returning a query response
Previous:From: Bruce MomjianDate: 2001-11-26 20:04:12
Subject: Re: grant/revoke bug with delete/update

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