Re: libpq: COPY FROM STDIN BINARY of arrays - Mailing list pgsql-general

From Dominique Devienne
Subject Re: libpq: COPY FROM STDIN BINARY of arrays
Date
Msg-id CAFCRh-8QhKRT3RTmQ+PzgwwHF6k_8iVNY4veE4eVJTarG0tHBA@mail.gmail.com
Whole thread Raw
In response to Re: libpq: COPY FROM STDIN BINARY of arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Mar 30, 2023 at 6:00 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Dominique Devienne <ddevienne@gmail.com> writes:
> Does the wire-format of arrays differ between binary-binds and binary-copy?

No.

An update on this, I think I figure it out, by comparing with COPY TO STDOUT WITH (FORMAT BINARY).
I was missing the byte-count "header" for the array. Since I'm reusing my binary-bind code for COPY,
I'm missing the 4 bytes for the array's "total encoded byte length" before the array data proper.
Now that I understand the issue, should be a simple matter to fix. Thanks for chiming in Tom. --DD

pgsql-general by date:

Previous
From: Siddharth Jain
Date:
Subject: Question on creating keys on partitioned tables
Next
From: Arnaud Lesauvage
Date:
Subject: Cannot terminate backend