Skip to content

Difference in behaviour when passing array formatted string parameters #205

@bencoder

Description

@bencoder

Describe the bug
We had a query like:
SELECT * FROM tableName WHERE columnName = ANY(:param)
and :param is a string like '{Value1,Value2}'

This was working fine when using local-data-api with postgres but on aws data-api failed with error:

ERROR: op ANY/ALL (array) requires array on right side\n Position: 464; SQLState: 42809

We fixed it by adding a cast as suggested in the inserting arrays workaround:

SELECT * FROM tableName WHERE columnName = ANY(CAST(:param AS text[]))

To Reproduce
As described above.

Expected behavior
The local-data-api should fail in the same way as aws data-api, as we now can't be sure that our queries that work locally will work on the real thing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions