Skip to content

[BUG] JSQLParser 5.1: PostgreSQL: fail to parse dollar-quoted string constants with tags #2233

@E1izabeth

Description

@E1izabeth

The parser fails to parse dollar-quoted string constants with tags (see https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING)
SQL example:

select
$json$
[
{"some":"json","with":"properties"},
{"other":"json","with":"properties"}
]
$json$::jsonb

The error I get:

net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "::" "::"
    at line 7, column 7.

Was expecting one of:

    <EOF>
    <ST_SEMICOLON>

However, replacing dollar-quotes $json$ with single quotes ' or removing the tag (to leave only double dollar $$) works.

Software Information:

  • JSqlParser 5.1
  • PostgreSQL

Additional information

It used to be supported in JSQLParser 4.5
Connected issue in DBeaver dbeaver/dbeaver#37028

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy