"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 ...
regards, tom lane