Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank? - Mailing list pgsql-general

From Tom Lane
Subject Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?
Date
Msg-id 3855181.1680097523@sss.pgh.pa.us
Whole thread Raw
In response to libpq: empty arrays have rank 0 in binary results? whatever the type's rank?  (Dominique Devienne <ddevienne@gmail.com>)
Responses Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
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=87c987fb2704761c59333bf8c1fee47e5c14c598;hb=HEAD#l1583

            regards, tom lane



pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?
Next
From: Dominique Devienne
Date:
Subject: Re: libpq: empty arrays have rank 0 in binary results? whatever the type's rank?