You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Dmitry Sysolyatin (Jira)" <ji...@apache.org> on 2022/11/28 18:07:00 UTC

[jira] [Created] (CALCITE-5403) PostgreSQL dialect should support SET, RESET, BEGIN, SHOW, ROLLBACK, COMMIT

Dmitry Sysolyatin created CALCITE-5403:
------------------------------------------

             Summary: PostgreSQL dialect should support SET, RESET, BEGIN, SHOW, ROLLBACK, COMMIT
                 Key: CALCITE-5403
                 URL: https://issues.apache.org/jira/browse/CALCITE-5403
             Project: Calcite
          Issue Type: Bug
          Components: babel
            Reporter: Dmitry Sysolyatin
            Assignee: Dmitry Sysolyatin


Babel parser can not parse BEGIN [1], SHOW [2], ROLLBACK [3], COMMIT [4] commands at the moment.

It can parse SET [5] and RESET [6], but not completely. For instance, it can not parse the following statement:
{code:java}
SET SCHEMA public,public,"$user"
{code}
The syntax for these commands is as follows:
 * BEGIN [1]:
{code:java}
BEGIN [ WORK | TRANSACTION ] [ transaction_mode [, ...] ] 

where transaction_mode is one of: ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } READ WRITE | READ ONLY [ NOT ] DEFERRABLE
{code}

 * SHOW [2]:
{code:java}
SHOW (<TRANSACTION ISOLATION LEVEL> | <string literal>)
{code}

 * ROLLBACK [3]:
{code:java}
ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
{code}

 * COMMIT [4]:
{code:java}
COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
{code}

 * SET [5]
{code:java}
SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
SET [ SESSION | LOCAL ] TIME ZONE { value | 'value' | LOCAL | DEFAULT }
SET [ SESSION | LOCAL ]  { SCHEMA | SEED | NAMES } value

Values can be specified as string constants, identifiers, numbers, or comma-separated lists of these
{code}

 * RESET [6]
{code:java}
RESET <parameter>;
{code}

[1] [https://www.postgresql.org/docs/current/sql-begin.html]
[2] [https://www.postgresql.org/docs/current/sql-show.html]
[3] [https://www.postgresql.org/docs/current/sql-rollback.html]
[4] [https://www.postgresql.org/docs/current/sql-commit.html]
[5] [https://www.postgresql.org/docs/current/sql-set.html]
[6] [https://www.postgresql.org/docs/current/sql-reset.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)