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 e6A1LUW30221; Sun, 9 Jul 2000 21:21:30 -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 VAA13646; Sun, 9 Jul 2000 21:21:12 -0400 (EDT) To: Philip Warner cc: Paul McGarry , pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] Re: [SQL] MAX() of 0 records. In-reply-to: <3.0.5.32.20000710102430.009bf510@mail.rhyme.com.au> References: <9124.962953563@sss.pgh.pa.us> <396535EF.8132CF80@opentec.com.au> <8477.962940582@sss.pgh.pa.us> <39656BD5.801BDEDC@opentec.com.au> <9124.962953563@sss.pgh.pa.us> <3.0.5.32.20000710102430.009bf510@mail.rhyme.com.au> Comments: In-reply-to Philip Warner message dated "Mon, 10 Jul 2000 10:24:30 +1000" Date: Sun, 09 Jul 2000 21:21:11 -0400 Message-ID: <13643.963192071@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/70 Philip Warner writes: >> 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. > Sounds perfect to me... Note that it would not meet your expectation that update t1 set f2=count(*) from t2 where t1.f1=2 and t2.f1=t1.f1 ; means the same as update t1 set f2=(Select Count(*) from t2 where t2.f1=t1.f1) where t1.f1 = 2 ... at least not without some kind of outer-join support too. With an inner join, t1 tuples not matching any t2 tuple wouldn't be modified at all. regards, tom lane