From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: david@daily-harvest.com
Subject: BUG #15143: Window Functions – Paranthese not allowed before OVER term
Date: Wed, 04 Apr 2018 23:41:48 +0000
Message-ID: <152288530821.1433.12335727835614659957@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15143
Logged by: David
Email address: david@daily-harvest.com
PostgreSQL version: 9.6.6
Operating system: Mac / DBeaver
Description:
```SELECT *,
(P2.received_at - LAG(P2.received_at)) OVER (PARTITION BY anonymous_id ORDER
BY P2.received_at DESC) AS time_diff
--((EXTRACT(EPOCH FROM (P2.received_at - LEAD(P2.received_at)))/60)) OVER
(PARTITION BY P2.anonymous_id ORDER BY P2.received_at DESC) AS
time_diff_minutes
FROM javascript.pages P2```
For the second line, I have to remove the parentheses around (P2.received_at
- LAG(P2.received_at)) for it to run. Which doesn't make sense. And more
importantly, I can't seem to get the 3rd line (currently commented out) to
run because of this issue of Postgres seeming to not allow parentheses
before the OVER
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: noreply@postgresql.org, david@daily-harvest.com
Subject: Re: BUG #15143: Window Functions – Paranthese not allowed before OVER term
In-Reply-To: <152288530821.1433.12335727835614659957@wrigleys.postgresql.org>
References: <152288530821.1433.12335727835614659957@wrigleys.postgresql.org>
* 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