Re: Array constructor requires one argument - Mailing list pgsql-general

From David Fetter
Subject Re: Array constructor requires one argument
Date
Msg-id 20070109221302.GO25475@fetter.org
Whole thread Raw
In response to Re: Array constructor requires one argument  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, Jan 09, 2007 at 04:09:21PM -0500, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> > Unless we can convince ourselves that array-of-UNKNOWN is not dangerous,
> > I don't think this is easily solved.
>
> One possibility that might handle Martijn's problem is to allow the
> construct
>
>     ARRAY[]::type[]
>
> that is, you can have an empty ARRAY construct only if you immediately
> cast it to a specific array type.  The application typically knows what
> type the data is anyway, and if it just always plasters on the cast then
> the syntax would work regardless of whether there are any elements or not.

+1 for doing it this way :)

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!

pgsql-general by date:

Previous
From: Jonathan Hedstrom
Date:
Subject: Re: ERROR: invalid memory alloc request size, and others
Next
From: Ben
Date:
Subject: Re: Postgres Replication