Re: [PATCH] Exorcise "zero-dimensional" arrays

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays
Date: 2013-04-01 04:21:22
Message-ID: CAFj8pRApAnGPzNfC+Xk2g=2EK5LCgM1k761t2SqJr=fzSdw14A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am not sure if CL is best example - it has no NULL SQL logic.

Current issue is introduced by design, where empty array is similar to NULL
(but not same) - what is on half way to Oracle varchar behave. But it is
not consistent with other data types in postgres.

Regards

Pavel

2013/3/31 Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > I understand, but I don't agree. W have to fix impractical design of
> > arrays early. A ARRAY is 1st class - so there is not possible to use
> > varchar2 trick.
> >
> > if we don't would to use GUC, what do you think about compatible
> > extension? We can overload a system functions behave. This can solve a
> > problem with updates and migrations.
>
> In Common Lisp arrays are multi-dimensional too, and the 1-D arrays have
> a specific name, they call them vectors. If you create an array with
> only 1 dimension, then it's a vector. All the array API works the same
> on vectors.
>
> I guess we could specialize some of our API on vectors and avoid having
> to tell the system which dimension we are interested into when using
> them rather than multi-dimensional arrays.
>
> Now from the internals perspective I also guess we don't want to be
> generating so many more types so maybe we would need some tricks to know
> how to promote a 1-D array into a vector automatically?
>
> --
> Dimitri Fontaine
> http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2013-04-01 06:35:59 Re: Hash Join cost estimates
Previous Message Dickson S. Guedes 2013-03-31 23:43:05 Fix JSON examples in docs