Re: Array constructor requires one argument

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Array constructor requires one argument
Дата
Msg-id 7580.1168356104@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Array constructor requires one argument  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Array constructor requires one argument  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Joris Dobbelsteen"
Дата:
Сообщение: Re: Autovacuum Improvements
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Questions about horizontal partitioning