Re: pgsql do not handle NULL constants in the view

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql do not handle NULL constants in the view
Дата
Msg-id 27257.1219236864@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgsql do not handle NULL constants in the view  (Sergey Hripchenko <shripchenko@intermedia.net>)
Ответы Re: pgsql do not handle NULL constants in the view  (Sergey Hripchenko <shripchenko@intermedia.net>)
Список pgsql-performance
Sergey Hripchenko <shripchenko@intermedia.net> writes:
> CREATE OR REPLACE VIEW bar AS
> SELECT *
> FROM (
>     (
>         SELECT calldate, duration, billsec, get_asterisk_cdr_caller_id(accountcode) AS caller_id
>         FROM asterisk_cdr
>     ) UNION ALL (
>         SELECT start_time, get_interval_seconds(completed_time-start_time),
get_interval_seconds(answered_time-start_time),NULL 
>         FROM asterisk_huntgroups_calls
>     )
> ) AS foo;

Try casting the NULL to integer (or whatever the datatype of the other
union arm is) explicitly.

            regards, tom lane

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

Предыдущее
От: "Kranti K K Parisa™"
Дата:
Сообщение: PostgreSQL+Hibernate Performance
Следующее
От: Sergey Hripchenko
Дата:
Сообщение: Re: pgsql do not handle NULL constants in the view