Re: Array dimension lost if dimension length is zero - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: Array dimension lost if dimension length is zero
Date
Msg-id 874m5pzgy1.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Array dimension lost if dimension length is zero  (Shay Rojansky <roji@roji.org>)
Responses Re: Array dimension lost if dimension length is zero  (Shay Rojansky <roji@roji.org>)
List pgsql-bugs
>>>>> "Shay" == Shay Rojansky <roji@roji.org> writes:

 >> This is intentional: all empty arrays are alike, with zero
 >> dimensions (not one dimension, but none).

 Shay> Also, note that when reading an empty array in binary encoding,
 Shay> the dimension field contains one.

Nope:

postgres=# select array_send('{}'::integer[]);
         array_send
----------------------------
 \x000000000000000000000017

(that's ndim=00000000, flags=00000000, element_oid=00000017)

--
Andrew (irc:RhodiumToad)

pgsql-bugs by date:

Previous
From: Shay Rojansky
Date:
Subject: Re: Array dimension lost if dimension length is zero
Next
From: Xtra Coder
Date:
Subject: Performance issue: jsonb_object_agg() is twice slower than to_jsonb()