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

2001-01-24 Thread Bruce Momjian


This still throws a strange error.  Someone want to fix it?

> 
> 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
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026



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

2000-10-10 Thread Bruce Momjian

I can confirm this is still a bug.


> 
> 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
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026