> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Can anyone explain this failure? It still exists in CVS.
> >> update t1 set f2=count(*) from t2 where t1.f1=2 and t2.f1=t1.f1 ;
> >> ERROR: ExecutePlan: (junk) `ctid' is NULL!
> As I recall, discussion about fixing that problem trailed off because
> no one could explain what an aggregate means in UPDATE. My thought
> is we should probably forbid the construct entirely (SQL does).
> See previous discussion around 7/7/00.
Oh, so it is the aggregate. What threw me off is that both parts of the
WHERE clause are required to cause the failure, so I thought it was
I don't see a problem with aggregates in UPDATE, except when the updated
field is part of the WHERE clause, but even then, transaction semantics
should make it matter. I see the mailist thread now.
I will try and get it added to the TODO list so it is documented.
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
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2001-11-27 00:28:31|
|Subject: Re: Minor buglet in update...from (I think) |
|Previous:||From: Tom Lane||Date: 2001-11-27 00:21:15|
|Subject: Re: Locale timings |