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 e67HD9W19571; Fri, 7 Jul 2000 13:13:09 -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 NAA10920; Fri, 7 Jul 2000 13:12:59 -0400 (EDT) To: Paul McGarry cc: pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] MAX() of 0 records. In-reply-to: <39659ACD.76A0E732@opentec.com.au> References: <396535EF.8132CF80@opentec.com.au> <8477.962940582@sss.pgh.pa.us> <39656BD5.801BDEDC@opentec.com.au> <9124.962953563@sss.pgh.pa.us> <39659ACD.76A0E732@opentec.com.au> Comments: In-reply-to Paul McGarry message dated "Fri, 07 Jul 2000 18:54:37 +1000" Date: Fri, 07 Jul 2000 13:12:59 -0400 Message-ID: <10917.962989979@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/53 Paul McGarry 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