Re: Array constructor requires one argument

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Array constructor requires one argument
Date: 2007-01-09 21:09:21
Message-ID: 10359.1168376961@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Conway <mail(at)joeconway(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Hedstrom 2007-01-09 21:13:27 Re: ERROR: invalid memory alloc request size, and others
Previous Message Tony Caduto 2007-01-09 20:52:11 Re: is there a tracking trace tool like the "SQL Analizer