pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: lead() with arrays - strange behaviour
Date: Thu, 8 Aug 2019 16:27:09 +0200
Message-ID: <d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net> (raw)
In-Reply-To: <13848.1565273434@sss.pgh.pa.us>
References: <bd1a59b7-0e3d-0a37-fe2d-f60e00dbb050@gmx.net>
	<CAKJS1f9hLjqQ+q6wEkU3CvuzR7GrvrDopOW6rTpceD9gTfxcUw@mail.gmail.com>
	<4f2f232b-7f3f-4d69-e448-2944e10682e7@gmx.net>
	<13848.1565273434@sss.pgh.pa.us>

Tom Lane schrieb am 08.08.2019 um 16:10:
> David's point is that the two occurrences of lead() don't mean the
> same thing.  A window function is directly tied to the SELECT that
> it is in the select-list of, and its notion of next and previous
> rows is concerned with the set of rows that that SELECT's FROM-clause
> generates.  In this example, the inner SELECT has an empty FROM that
> returns one row, so the lead() in that SELECT doesn't do anything
> useful.

Ah! Now I get it ;) 

Thanks for clearing that up.

> You could probably get where you want to go with something along
> the lines of

Yes, that's what I did in the end (see my initial post)






view thread (5+ messages)

Message-ID: <d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net>
Permalink:  ../d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net/
Also on:    postgresql.org/message-id/d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net

 · 

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-general@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: lead() with arrays - strange behaviour
  In-Reply-To: <d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net>
  References: <bd1a59b7-0e3d-0a37-fe2d-f60e00dbb050@gmx.net> <CAKJS1f9hLjqQ+q6wEkU3CvuzR7GrvrDopOW6rTpceD9gTfxcUw@mail.gmail.com> <4f2f232b-7f3f-4d69-e448-2944e10682e7@gmx.net> <13848.1565273434@sss.pgh.pa.us> <d4f4eb9d-2e00-899f-d9ba-e386d098021d@gmx.net>

* 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