Re: COALESCE requires NULL from scalar subquery has a type

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: COALESCE requires NULL from scalar subquery has a type
Дата
Msg-id CAEzk6fd1g6SVrUYJPKNc5hA4DjX1CcCZFWEGMSQrQ=98sy1rGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COALESCE requires NULL from scalar subquery has a type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: COALESCE requires NULL from scalar subquery has a type  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 9 February 2016 at 14:53, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> SELECT COALESCE((SELECT 'Yes' FROM gwtest WHERE id=4), 'No') AS valid;
>
> There's no null visible anywhere in that.  I suppose that if there's
> no row with id=4, there would be a null at runtime,

Well yes, that was the whole point.

> but that's not
> going to make any difference for parse-time determination of what
> type the COALESCE() will return.

But when the gwtest subquery _does_ return a value it works, so the
problem can't be parse-time determination, can it?

Geoff


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COALESCE requires NULL from scalar subquery has a type
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: COALESCE requires NULL from scalar subquery has a type