Re: ERROR: ExecutePlan: (junk) `ctid' is NULL!

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: ExecutePlan: (junk) `ctid' is NULL!
Date: 2003-04-30 05:59:26
Message-ID: 20030430005926.S66185@flake.decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 29, 2003 at 06:36:59PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jim(at)nasby(dot)net> writes:
> > stats=> UPDATE Tsummary
> > stats-> SET participants = count(distinct credit_id)
> > stats-> , teams = count(distinct team_id)
> > stats-> FROM email_contrib_today ect
> > stats-> WHERE ect.project_id = :ProjectID
> > stats-> ;
> > ERROR: ExecutePlan: (junk) `ctid' is NULL!
>
> We really oughta reject UPDATE commands with aggregates at the top
> level. It's not well-defined, it's illegal per SQL spec, and it tends
> to get the executor all confused ...

The problem is that pgsql doesn't support

UPDATE table
SET (field1, field2, field3) =
(SELECT min(blah), max(blah), count(*) FROM table2)

This makes it a real pain to code this using subselects. UPDATE ... FROM
is real handy to have, but I think there's also plenty of occasions
where the ability to set multiple fields at once would be very useful
too.
--
Jim C. Nasby (aka Decibel!) jim(at)nasby(dot)net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2003-04-30 06:20:20 Re: Performance problems
Previous Message Jim C. Nasby 2003-04-30 05:56:11 Re: Optimizer not using index on 120M row table