Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e69Ia6W43438; Sun, 9 Jul 2000 14:36:06 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA29288; Sun, 9 Jul 2000 14:35:40 -0400 (EDT) To: Paul McGarry , pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [SQL] MAX() of 0 records. In-reply-to: <9124.962953563@sss.pgh.pa.us> References: <396535EF.8132CF80@opentec.com.au> <8477.962940582@sss.pgh.pa.us> <39656BD5.801BDEDC@opentec.com.au> <9124.962953563@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 07 Jul 2000 03:06:03 -0400" Date: Sun, 09 Jul 2000 14:35:40 -0400 Message-ID: <29285.963167740@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/69 I wrote: > Comments anyone? What exactly *should* be the behavior of an UPDATE > that uses an aggregate function and a join to another table? Over what > set of tuples should the aggregate be evaluated? Further note on this: SQL99 specifies: ::= UPDATE SET [ WHERE ] ... 5) A in a shall not directly contain a . so the construct is definitely not SQL-compliant. Maybe we should just forbid it. However, if you are joining against another table (which itself is not an SQL feature) then it seems like there is some potential use in it. What do people think of my implicit-GROUP-BY-ctid idea? That would basically say that the aggregate is computed over all the tuples that join to a single target tuple. regards, tom lane