Array constructor requires one argument

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Array constructor requires one argument
Date: 2007-01-09 10:25:01
Message-ID: 20070109102501.GA8359@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there a particular reason why the array constructor requires at
least one argument? It's a bit irriating to have to special case zero
length arrays.

# select array[];
ERROR: syntax error at or near "]" at character 14
# select array[1];
array
-------
{1}
(1 row)

# select '{}'::int4[];
int4
------
{}
(1 row)

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2007-01-09 11:42:47 Confused by misleading error message on SP creation
Previous Message Csaba Nagy 2007-01-09 10:06:55 Re: [OT] Advice needed on using postgres in commercial