BUG #15143: Window Functions – Paranthese not allowed before OVER term - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15143: Window Functions – Paranthese not allowed before OVER term
Date
Msg-id 152288530821.1433.12335727835614659957@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #15143: Window Functions – Paranthese not allowed before OVER term
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #15143: Window Functions – Paranthese not allowed before OVER term