Skip to content

[Postgres] Parsing sequence of SHOW and SET is a bit off #1994

@vrmiguel

Description

@vrmiguel
Parser::parse_sql(&PostgreSqlDialect {}, "SHOW search_path; SHOW timezone; SET search_path TO public;").unwrap()

The above results in:

[
    ShowVariable {
        variable: [
            Ident {
                value: "search_path",
                quote_style: None,
                span: Span(Location(1,6)..Location(1,17)),
            },
            Ident {
                value: "SHOW",
                quote_style: None,
                span: Span(Location(1,19)..Location(1,23)),
            },
            Ident {
                value: "timezone",
                quote_style: None,
                span: Span(Location(1,24)..Location(1,32)),
            },
            Ident {
                value: "SET",
                quote_style: None,
                span: Span(Location(1,34)..Location(1,37)),
            },
            Ident {
                value: "search_path",
                quote_style: None,
                span: Span(Location(1,38)..Location(1,49)),
            },
            Ident {
                value: "TO",
                quote_style: None,
                span: Span(Location(1,50)..Location(1,52)),
            },
            Ident {
                value: "public",
                quote_style: None,
                span: Span(Location(1,53)..Location(1,59)),
            },
        ],
    },
]

Its Display impl results in "SHOW search_path SHOW timezone SET search_path TO public"

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