Skip to content

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

Description

@dguy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions