Search Postgresql Archives

Re: Array constructor requires one argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martijn van Oosterhout <kleptog@xxxxxxxxx> writes:
> On Tue, Jan 09, 2007 at 10:02:09AM -0500, Tom Lane wrote:
>> Define the data type of
>> SELECT ARRAY[];

> The same type as:
> SELECT NULL;

Hardly, because whatever type NULL has, it's not an array type.

> In fact, you could just make it an unknown
> literal with just two curly vrace and you'd be all set.

Nope.  '{}' without any other decoration isn't an array at all.
You're confusing external representation with what the system
(thinks it) knows about the type of an expression.

As an example, if we did what I think you're proposing, this
would succeed:

	SELECT ARRAY[]::text;

whereas it certainly ought not, because there is no cast from
any array type to a scalar text value.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux