Re: array support patch phase 1 patch

From: Joe Conway <mail(at)joeconway(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: array support patch phase 1 patch
Date: 2003-06-09 05:11:28
Message-ID: 3EE41700.2070202@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut wrote:
[...much snipping follows...]
> No, the analogues would be "unidimensional", "bidimensional", and
> "many-dimensional". There difference is that you close up prefixes (which
> are not words by themselves), but you hyphenate compounds of independent
> words.
>
>>>The function array_subscript() should be removed from code and
>>>The function array_assign() should be removed from code and documentation.
>>>The function singleton_array() should be removed from code and
>>
>>>The function array_append() should be documented as being equivalent to
>>>'array || element' and specifically intended for user-defined aggregate
>>>functions.
>>
>>That's fine. I would add similar descriptions for array_prepend() and
>>array_cat().
>
> Sounds good. My main concern is that people will have a clear view of
> what's standard and recommended for which situation, so that support will
> be easier and users won't be confronted with a long list of equivalent,
> undifferentiated options.
>

The attached patch addresses Peter's concerns, subject to our agreements
above. I.e, the changes are:

1) All instances of "multi-dimensional array" and "multiple dimension
array" throughout the source tree have been changed to "multidimensional
array". Even if everyone doesn't agree this is correct, it is at least
consistent throughout, so if we later decide to change it back, it will
be easier ;-)

2) The functions singleton_array(), array_assign(), and
array_subscript() have been removed along with all references thereof.

3) The documentation emphasizes use of the concatenation operator '||'
as preferred over the functions array_append(), array_prepend(), and
array_cat(). A mention of direct use of the functions in user-defined
aggregates is also included.

[...more snipage from a different part of the thread...]
Tom Lane wrote:
> BTW, it might be better for array_cmp to insist that the array element
> type have a default btree opclass, and use the comparison proc from
> that opclass in place of equality_oper() and ordering_oper(). This'd
> be faster (only one call per comparison) as well as more semantically
> pure.

I stopped short of this change because there doesn't seem to be a way to
get the btree opclass tuple given just the opcintype without scanning
pg_opclass. Am I missing something? Or should I just not worry about it
and scan pg_opclass?

> I've got some other problems with this patch (I still don't understand
> what the hacking on aggregates is supposed to accomplish, for example)
> but the array comparison stuff seems relatively straightforward.

As I said in an earlier message, I believe that I have implemented this
correctly. Is there a specific corner case not covered? I'd really like
to see some form of polymorphic function support for aggregates --
please let me know what I can do to make that happen.

Joe

p.s. I added Bruce to the thread because he asked me about the status of
the patch, and because the lists have been so slow the last few days.

Attachment Content-Type Size
array-combo.05.patch text/plain 165.4 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Kurt Roeckx 2003-06-09 12:32:00 Re: Ipv6 network cleanup patch #2.
Previous Message Bruce Momjian 2003-06-09 01:28:26 Re: [BUGS] Detecting proper bison version before make