Skip to content

[pg] Support cast types for WHERE IN #2957

@rekby

Description

@rekby

Run local YDB: https://github.com/ydb-platform/ydb/wiki/Local-run-postgres-tests

echo "
  DROP TABLE IF EXISTS t;
  CREATE TABLE t (id int8, PRIMARY KEY (id));
  SELECT * FROM t WHERE id IN (1);
  " | psql postgres://root:1234@localhost:5432/local

Result:

DROP TABLE
CREATE TABLE
Status: GENERIC_ERROR
Issues:
<main>: Error: Type annotation, code: 1030
    <main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect
        <main>: Error: At function: PgSetItem
            <main>:1:1: Error: At function: PgWhere
                <main>:1:26: Error: At function: PgIn
                    <main>:1:26: Error: Mismatch of types in IN expressions: int8 is not equal to int4

Expected result:

DROP TABLE
CREATE TABLE
 id
----
(0 rows)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions