Re: Why do subselects in target lists behave differently wrt implicit casts?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why do subselects in target lists behave differently wrt implicit casts?
Дата
Msg-id 19378.1089485907@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why do subselects in target lists behave differently wrt implicit casts?  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> This is a really trivial question, but I'm curious. Why do
> subselects in target lists behave differently than simple queries?

> [lexus] insert into bar select '';
> INSERT 1319585 1
> [lexus] insert into bar select (select '') as key;
> ERROR:  failed to find conversion function from "unknown" to
> character varying

The undecorated literal constant starts out marked as type UNKNOWN.
There is a hack to reinterpret it as the type of the destination
column in an INSERT context.  The hack doesn't know anything about
looking inside subselects, though.

            regards, tom lane

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

Предыдущее
От: Bret Busby
Дата:
Сообщение: Re: Training and certification
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: win32 port