Re: BUG #15606: Postgres incorrectly returns syntax error when usingWITH clacuse

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15606: Postgres incorrectly returns syntax error when usingWITH clacuse
Дата
Msg-id CAKFQuwYxR_6tyAnJOw1kPW=+=6C3bZosRqUY_=bWft9FPPyEHQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #15606: Postgres incorrectly returns syntax error when using WITHclacuse  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Wed, Jan 23, 2019 at 7:40 AM PG Bug reporting form
<noreply@postgresql.org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference:      15606
> Logged by:          Rikke Hammer
> Email address:      newsx@outlook.com
> PostgreSQL version: 11.1
> Operating system:   Windows 10 Home  version1803 x64
> Description:
>
> I get a syntax error when I try to use a WITH clause in a query. Below is a
> simple test query. It (as as well as any other WITH clause query I do,
> creates the following error:
>
>           SQL Error [42601]: ERROR: syntax error at end of input
>           Position: 53
[...]
> WITH emp AS (
> select * from rikke_hammer.employees)

If you actually just want to execute the query you are putting into
the WITH what is the point of wrapping it with "WITH"?

This is not a bug.  As the error message indicates the parser is
expecting you to write more sql stuff.  In this case a SELECT
statement that actually uses the emp CTE

[ WITH [ RECURSIVE ] with_query [, ...] ]
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
...

David J.


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15606: Postgres incorrectly returns syntax error when using WITHclacuse
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15605: Unstable regression test "tablespace"