pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Window function bug
Date: Tue, 12 Jul 2011 11:20:39 -0400
Message-ID: <12936.1310484039@sss.pgh.pa.us> (raw)
In-Reply-To: <12015.1310480904@sss.pgh.pa.us>
References: <1310431686.497.26.camel@jdavis-ux.asterdata.local>
	<12015.1310480904@sss.pgh.pa.us>

I wrote:
> ... so I guess the answer is that this code ought to avoid adding Vars that
> are only mentioned within aggregates.

The cleanest way to fix this would involve adding another flag parameter
to flatten_tlist and pull_var_clause.  This is no problem to do in HEAD
or even 9.1, but I'm a bit worried about breaking third-party code if we
backpatch further than that.  So far as I can see, the failure only
occurs if we have a plain (non-grouping) Agg node, which implies that
the user is trying to use windowing functions on a result set that's
guaranteed to contain exactly one aggregated row.  That seems pretty
useless, so I'm thinking it's not worth back-patching a fix for.
Comments?

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <12936.1310484039@sss.pgh.pa.us>
Permalink:  ../12936.1310484039@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12936.1310484039@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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com
  Subject: Re: Window function bug
  In-Reply-To: <12936.1310484039@sss.pgh.pa.us>
  References: <1310431686.497.26.camel@jdavis-ux.asterdata.local> <12015.1310480904@sss.pgh.pa.us> <12936.1310484039@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