Skip to content

PG: PortalSuspended for array of composite types #1254

Closed
@fominok

Description

@fominok

Hello,

DDL

create type pair as (one int, two int);
create table test (id int primary key, pairs pair[]);

Rust structs

#[derive(sqlx::Type)]
#[sqlx(type_name = "pair")]
struct Pair {
    one: i32,
    two: i32,
}

#[derive(sqlx::Type)]
#[sqlx(type_name = "_pair")]
struct WrappedPairs(Vec<Pair>);

Query

sqlx::query!(
    "INSERT INTO test VALUES($1, $2)",
    0,
    WrappedPairs(vec![Pair { one: 4, two: 20 }]) as _
)
.execute(pool)
.await?;

Perhaps I do it wrong, but this code gives me Protocol("execute: unexpected message: PortalSuspended").

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