Re: libpq: COPY FROM STDIN BINARY of arrays

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: libpq: COPY FROM STDIN BINARY of arrays
Date: 2023-03-31 12:34:22
Message-ID: CAFCRh-8QhKRT3RTmQ+PzgwwHF6k_8iVNY4veE4eVJTarG0tHBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 30, 2023 at 6:00 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Dominique Devienne <ddevienne(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arnaud Lesauvage 2023-03-31 13:46:39 Cannot terminate backend
Previous Message Siddharth Jain 2023-03-31 00:05:30 Question on creating keys on partitioned tables