Skip to content

SQL Parser fails on SET TIME ZONE syntax #9936

@mattsax

Description

@mattsax

Failed SQL

SET TIME ZONE 'UTC';
-- ERROR:  Unable to parse: ParserError("Expected equals sign or TO, found: ZONE")

Tool
This SQL was generated by Looker while trying to setup a connection, using Postgresql 9.5+ dialect.
It seems that Looker attempts to set the session time zone upon establishing a database connection.

Version:
v1.3

Additional context

I have manually tested several variations of the command. According to the official PostgreSQL documentation the following syntaxes are all valid:

SET TIME ZONE 'UTC';
-- ERROR:  Unable to parse: ParserError("Expected equals sign or TO, found: ZONE")
SET TIME ZONE TO 'UTC';
-- ERROR:  Unable to parse: ParserError("Expected equals sign or TO, found: ZONE")
SET TIMEZONE TO 'UTC';                                                                                                                                                                  
-- SET => This one works

Metadata

Metadata

Assignees

Labels

api:sqlIssues related to SQL API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions