Обсуждение: Request for Formal Syntax of WHERE Clause Conditions

Поиск
Список
Период
Сортировка

Request for Formal Syntax of WHERE Clause Conditions

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-select.html
Description:

Dear PostgreSQL Team,

I am building a PostgreSQL parser and need a precise reference for the
formal syntax of condition used in the WHERE clause. While the documentation
covers many aspects in detail, I could not find a formal definition for what
constitutes a valid condition.

This information is critical for accurately parsing queries. Could you
please provide clarity or point me to relevant resources?

Thank you for your assistance!

Best regards,

Re: Request for Formal Syntax of WHERE Clause Conditions

От
Tom Lane
Дата:
PG Doc comments form <noreply@postgresql.org> writes:
> I am building a PostgreSQL parser and need a precise reference for the
> formal syntax of condition used in the WHERE clause.

We do not have one.  You might be able to extract what you need from
our Bison grammar though:


https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/gram.y;h=d7f9c00c4099bd86c39ce79c997123a2a0ca6782;hb=HEAD

starting more or less from the a_expr production.

Keep in mind that this is a moving target, as we frequently add
new syntax features.

            regards, tom lane