Re: pgsql do not handle NULL constants in the view

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

 



Sergey Hripchenko <shripchenko@xxxxxxxxxxxxxx> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux