Thread: BUG #17708: 12.4

BUG #17708: 12.4

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      17708
Logged by:          zoro roronoa
Email address:      nodepill@gmail.com
PostgreSQL version: 15.1
Operating system:   macOS 12.4
Description:

PostgreSQL 14.6 on x86_64-apple-darwin20.6.0, comp


WITH RECURSIVE search_tree(id, link, data) AS (
                     SELECT t.id, t.link, t.data
                     FROM tree t
                     UNION ALL
                     SELECT t.id, t.link, t.data
                     FROM tree t join  search_tree st on  t.id = st.link
                     WHERE  t.id < 2
                 ) SEARCH DEPTH FIRST BY id SET ordercol


 [42601] ERROR: syntax error at end of input

But run ok in PostgreSQL 15.1 (Debian 15.1-1.pgdg110+1) on
x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110,
64-bit


Re: BUG #17708: 12.4

From
Tom Lane
Date:
PG Bug reporting form <noreply@postgresql.org> writes:
> WITH RECURSIVE search_tree(id, link, data) AS (
>                      SELECT t.id, t.link, t.data
>                      FROM tree t
>                      UNION ALL
>                      SELECT t.id, t.link, t.data
>                      FROM tree t join  search_tree st on  t.id = st.link
>                      WHERE  t.id < 2
>                  ) SEARCH DEPTH FIRST BY id SET ordercol

>  [42601] ERROR: syntax error at end of input

Yeah ... you wrote a WITH clause, but where's the main SELECT?

> But run ok in PostgreSQL 15.1

I *seriously* doubt that.

            regards, tom lane