Re: [HACKERS] Missing array support

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Missing array support
Date: 2003-06-30 20:18:29
Message-ID: 17176.1057004309@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:
> Tom Lane wrote:
>> You're not providing enough info to resolve_type to let it handle all
>> four cases correctly.

> No, resolve_type() is not at all specific to polymorphic aggregates. It
> implements the rules of polymorphism that we previously agreed to,
> namely that an ANYARRAY can be resolved by knowing any of these data
> types at the time of function call:

> 1) the actual call type at the same position (i.e. argument number or
> return type) as the ANYARRAY you're trying to resolve

> 2) the actual call type at a different position from the ANYARRAY you're
> trying to resolve, as long as the declared type at that position is
> either ANYARRAY or ANYELEMENT.

But you still need three pieces of info, and it's only being given two.
In the second case (where you know actual argument type at a different
position) you must know whether the other position's declared type is
anyarray or anyelement, and you can't assume it's the same as the one at
the position you want to resolve.

> Did you find a specific case where this falls down?

It fails to raise errors in cases where errors should be raised,
but instead delivers the wrong datatype as result. It can also
incorrectly replace an arraytype by its element type ("ANYELEMENT"
doesn't require the actual type to not be an array --- unless
"ANYARRAY" is also used in the same declaration, and even then
it's only going to fail because we don't support arrays of arrays).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tilo Schwarz 2003-06-30 20:28:56 Re: PlPython
Previous Message Joe Conway 2003-06-30 19:55:44 Re: [HACKERS] Missing array support

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2003-06-30 20:42:22 Re: [HACKERS] Missing array support
Previous Message Joe Conway 2003-06-30 19:55:44 Re: [HACKERS] Missing array support