JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

TIME WITH TIME ZONE

Open sixinli opened this issue 2 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. SELECT TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
  2. Parsing this SQL using JSqlParser with this statements
org.junit.ComparisonFailure: Expected query to parse but it failed to parse (error: Encountered unexpected token: "TIMESTAMP WITH TIME ZONE" <DT_ZONE>
    at line 1, column 8.

Was expecting one of:

    "*"
    "STRAIGHT_JOIN"
) expected:<[tru]e> but was:<[fals]e>

Expected behavior expect the query to parse

System

  • postgres
  • java 11
  • JSqlParser 4.2

sixinli avatar Oct 11 '21 23:10 sixinli

Duplicate of #1344, it is not about the Timezone but about casting the String.

Explicit Cast works

manticore-projects avatar Oct 12 '21 00:10 manticore-projects

works

SELECT '2004-10-19 10:23:54+02'::TIMESTAMP WITH TIME ZONE

wumpz avatar Oct 14 '21 05:10 wumpz

thanks for the magic fix!!

sixinli avatar Apr 09 '24 20:04 sixinli