Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Florian Pflug <fgp(at)phlo(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date: 2013-04-04 04:54:54
Message-ID: CADxJZo3GWjq8q62hsqrLxTDK1advjj5j3kpNHF1mKQdLLoJpbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4 April 2013 15:11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Brendan Jurd <direvus(at)gmail(dot)com> writes:
>> My thought was that on-disk zero-D arrays should be converted into
>> empty 1-D arrays (with default lower bounds of course) when they are
>> read by array_recv.
>
> Huh? array_recv would not get applied to datums coming off of disk.

My mistake, sorry for the noise.

> In any case, the whole exercise is pointless if we don't change the
> visible behavior of array_dims et al. So I think the idea that this
> would be without visible consequence is silly. What's up for argument
> is just how much incompatibility is acceptable.

I don't know that anyone was suggesting there would be no visible
consequences of any kind. I was hoping that we could at least
represent on-disk zero-D arrays as though they were 1-D.

If that's not going to fly, and we are stuck with continuing to allow
zero-D as a valid representation, then perhaps your '[]=' syntax would
be the way to proceed. It would not be terribly difficult to rework
the patch along those lines, although I have to admit "allow empty
arrays with dimensions" is not nearly so satisfying a title as
"exorcise zero-dimensional arrays".

Cheers,
BJ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2013-04-04 05:18:39 Re: Patch for checking file parameters to psql before password prompt
Previous Message Tom Lane 2013-04-04 04:11:15 Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)