Paul McGarry <[EMAIL PROTECTED]> writes:
> Would that mean that any update that used an aggregate function
> would be invalid? That would be a bit scary seeing as I am doing
> this in part to get around using aggregate functions in a view.

You'd have to embed the aggregate in a sub-select if we did things
that way.  I'd rather not have such a restriction, but only if we can
understand clearly what it means to put an aggregate directly into
UPDATE.  The executive summary of what I said before is "exactly what
SHOULD this query do, anyway?"  I think it's not well-defined without
some additional assumptions.

>> Another way to look at it is that perhaps an UPDATE involving aggregate
>> functions ought to be implicitly treated as GROUP BY targetTable.ctid.

> What exactly is a ctid?

Physical location of the tuple, expressed as block# and tuple# within
the file.  Try "select ctid,* from sometable" ...

                        regards, tom lane

Reply via email to