JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

[BUG] JSQLParser 4.5 : Postgres : fails to parse `interval hour to minute`

Open dguy opened this issue 2 years ago • 0 comments

Failing SQL Feature:

When parsing an example (taken from the postgres website: https://www.postgresql.org/docs/current/sql-createtable.html) that uses interval hour to minute in CREATE TABLE... parsing fails with:

Failed to parse query. Proceeding with query execution
net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "hour" <K_DATE_LITERAL>
    at line 7, column 26.

SQL Example:

CREATE TABLE films (
    code        char(5),
    title       varchar(40),
    did         integer,
    date_prod   date,
    kind        varchar(10),
    len         interval hour to minute,
    CONSTRAINT production UNIQUE(date_prod)
);

Software Information:

  • JSqlParser 4.5
  • PostgreSQL

dguy avatar Feb 13 '23 14:02 dguy