pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Shay Rojansky <roji@roji.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Array dimension lost if dimension length is zero
Date: Fri, 09 Sep 2016 08:13:41 +0100
Message-ID: <874m5pzgy1.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CADT4RqD6d=pDokO+cVUcU27ZF7uOyZ45jtkS_Y549MTEzRZeSA@mail.gmail.com>
References: <CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com>
	<19962.1473355922@sss.pgh.pa.us>
	<CADT4RqD6d=pDokO+cVUcU27ZF7uOyZ45jtkS_Y549MTEzRZeSA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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)


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <874m5pzgy1.fsf@news-spur.riddles.org.uk>
Permalink:  ../874m5pzgy1.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/874m5pzgy1.fsf@news-spur.riddles.org.uk

 · 

reply

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-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, roji@roji.org, tgl@sss.pgh.pa.us
  Subject: Re: Array dimension lost if dimension length is zero
  In-Reply-To: <874m5pzgy1.fsf@news-spur.riddles.org.uk>
  References: <CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com> <19962.1473355922@sss.pgh.pa.us> <CADT4RqD6d=pDokO+cVUcU27ZF7uOyZ45jtkS_Y549MTEzRZeSA@mail.gmail.com> <874m5pzgy1.fsf@news-spur.riddles.org.uk>

* 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