From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?
Date: Wed, 29 Mar 2023 09:45:23 -0400
Message-ID: <3855181.1680097523@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-82ACBOdFA3BxevZQn4AZuUTi6Z5-q1T99OE=tM5hA9cw@mail.gmail.com>
References: <CAFCRh-82ACBOdFA3BxevZQn4AZuUTi6Z5-q1T99OE=tM5hA9cw@mail.gmail.com>
Dominique Devienne <ddevienne@gmail.com> writes:
> Hi. Selecting/fetching an empty 1D array using a binary-mode PGresult,
> gives me back 12 bytes, and the first 4, the rank, is 0, something I was
> not expecting.
Yeah, empty arrays have zero dimensions.
> PS: On a side note; where can I find the sending code for arrays?
> I didn't find the usual _send() and _recv() functions (but looking on
> github online...)
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/arrayfuncs.c;h=87...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ddevienne@gmail.com
Subject: Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?
In-Reply-To: <3855181.1680097523@sss.pgh.pa.us>
References: <CAFCRh-82ACBOdFA3BxevZQn4AZuUTi6Z5-q1T99OE=tM5hA9cw@mail.gmail.com> <3855181.1680097523@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox