Re: Array dimension lost if dimension length is zero

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Shay Rojansky <roji(at)roji(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Array dimension lost if dimension length is zero
Date: 2016-09-09 07:13:41
Message-ID: 874m5pzgy1.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Shay" == Shay Rojansky <roji(at)roji(dot)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)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Xtra Coder 2016-09-09 08:12:46 Performance issue: jsonb_object_agg() is twice slower than to_jsonb()
Previous Message Shay Rojansky 2016-09-09 06:51:40 Re: Array dimension lost if dimension length is zero