pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Philip Warner <pjw@rhyme.com.au>
Cc: Paul McGarry <paulm@opentec.com.au>
Cc: pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Re: [SQL] MAX() of 0 records.
Date: Sun, 09 Jul 2000 21:21:11 -0400
Message-ID: <13643.963192071@sss.pgh.pa.us> (raw)
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>

Philip Warner <pjw@rhyme.com.au> 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



view thread (18+ messages)  latest in thread

Message-ID: <13643.963192071@sss.pgh.pa.us>
Permalink:  ../13643.963192071@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13643.963192071@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pjw@rhyme.com.au, paulm@opentec.com.au, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Re: [SQL] MAX() of 0 records.
  In-Reply-To: <13643.963192071@sss.pgh.pa.us>
  References: <9124.962953563@sss.pgh.pa.us> <396535EF.8132CF80@opentec.com.au> <8477.962940582@sss.pgh.pa.us> <39656BD5.801BDEDC@opentec.com.au> <3.0.5.32.20000710102430.009bf510@mail.rhyme.com.au> <13643.963192071@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox