Skip to content

PG: PortalSuspended for array of composite types #1254

Closed

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").

Activity

  1. abonander commented on Aug 16, 2021

    @abonander
    Collaborator

    Closed by #1363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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