Skip to content

nextval generates incorrect SQL for sequences with an explicit schema in rel8 1.4.1.0 #228

@elldritch

Description

@elldritch

I believe this is a regression introduced by #217.

In rel8 1.4.0.0, calling nextval "foo.bar" to get the next value of a sequence bar in a schema foo used to generate the SQL nextval(CAST(E'foo.bar' AS text)), which is nextval('foo.bar').

However, in 1.4.1.0, it now generates nextval(CAST(quote_ident(CAST(E'foo.bar' AS text)) AS text)), which is nextval(quote_ident('foo.bar')) which is nextval('"foo.bar"'). This SQL is incorrect, and causes an error relation "foo.bar" does not exist because it's trying to access the sequence named "foo.bar" in the current schema, when in reality I want the sequence bar in schema foo.

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