Skip to content

Invalid PostgreSQL ALTER TYPE ... RENAME TO ... statements #898

@timothee-haudebourg

Description

@timothee-haudebourg

Description

The new type identifier in PostgreSQL ALTER TYPE old_ident RENATE TO new_ident statements is encoded as a string value instead of an identifier, triggering a syntax error.

Steps to Reproduce

Type::alter().name(OldIdent).rename_to(NewIdent)

Expected Behavior

Should be compiled to

ALTER TYPE "old_ident" RENAME TO "new_ident"

or

ALTER TYPE old_ident RENAME TO new_ident

Actual Behavior

Is compiled to

ALTER TYPE "old_ident" RENAME TO 'new_ident'

which is an invalid syntax for this statement.

Reproduces How Often

Always reproducible.

Versions

I'm using 0.32, but this bug is present since the implementation of ALTER TYPE in #42 .

Additional Information

The line triggering the bug: https://github.com/SeaQL/sea-query/blame/16226158bf9dc825bbc49f0b678bccd7c3eb15df/src/backend/postgres/types.rs#L116

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