Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Query fails in redshift. #330

Closed
Closed
@glennpierce

Description

@glennpierce

Hi

I have some code of a simple query

let results : postgres::Result<Rows> = self.conn.query("SELECT id, name FROM sensors WHERE id = ANY($1)", &[&sensor_ids]);

where

sensor_ids is sensor_ids : Vec<i32>

This works fine against my local postgres db (9.5)

I am now trying to move to redshift but I get the error

Err(Error(Db(DbError { severity: "ERROR", parsed_severity: None, code: SqlState("22P03"), message: "invalid array flags", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("/home/ec2-user/padb/src/pg/src/backend/utils/adt/arrayfuncs.c"), line: Some(1174), routine: Some("array_recv") })))
Any idea what this could be ?

PS.

If I query through my ide
SELECT id, name FROM sensors WHERE id = ANY(ARRAY[596304,597992,610978,597998])

It works

Thanks

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