Re: SQL99 ARRAY support proposal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL99 ARRAY support proposal
Date: 2003-03-10 04:07:46
Message-ID: 10951.1047269266@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:
> It seems that "any" is not accepted as a function parameter type.

You have to double-quote it.

We could perhaps rename it to avoid the keyword conflict; I'd lean
towards "anytype" if we do ("anyscalar" seems misleading; I'd expect
that to exclude arrays). I think I chose ANY because there was
precedent in CREATE AGGREGATE for that.

> So far, so good. But now the second problem:
> select f1[2] from
> (select array_push('{1,2}'::integer[],3::integer) as f1) as t;
> ERROR: transformArraySubscripts: type anyarray is not an array

Mph. I'm not sure we can make that work readily ... unless you want
to make the parser assume that a function taking and returning ANYARRAY
actually returns the same array type as its input is. Otherwise the
parser has no way to determine the datatype yielded by f1[2].

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2003-03-10 06:57:53 Re: SQL99 ARRAY support proposal
Previous Message Joe Conway 2003-03-10 03:35:52 Re: SQL99 ARRAY support proposal

Browse pgsql-patches by date

  From Date Subject
Next Message Hannu Krosing 2003-03-10 06:57:53 Re: SQL99 ARRAY support proposal
Previous Message Joe Conway 2003-03-10 03:35:52 Re: SQL99 ARRAY support proposal