Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5403

Babel parser should parse PostgreSQL's SET, RESET, BEGIN, SHOW, ROLLBACK, COMMIT commands

    XMLWordPrintableJSON

Details

    Description

      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:

      SET SCHEMA public,public,"$user"
      

      The syntax for these commands is as follows:

      • BEGIN [1]:
        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
        
      • SHOW [2]:
        SHOW (<TRANSACTION ISOLATION LEVEL> | <string literal>)
        
      • ROLLBACK [3]:
        ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
        
      • COMMIT [4]:
        COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
        
      • SET [5]
        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
        
      • RESET [6]
        RESET <parameter>;
        

      [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

      Attachments

        Issue Links

          Activity

            People

              dmsysolyatin Dmitry Sysolyatin
              dmsysolyatin Dmitry Sysolyatin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m