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

Paul McGarry <paulm@opentec.com.au> 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



view thread (18+ messages)  latest in thread

Message-ID: <10917.962989979@sss.pgh.pa.us>
Permalink:  ../10917.962989979@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10917.962989979@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, paulm@opentec.com.au, pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] MAX() of 0 records.
  In-Reply-To: <10917.962989979@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> <39659ACD.76A0E732@opentec.com.au> <10917.962989979@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