pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sergey Hripchenko <shripchenko@intermedia.net>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: pgsql do not handle NULL constants in the view
Date: Wed, 20 Aug 2008 08:54:24 -0400
Message-ID: <27257.1219236864@sss.pgh.pa.us> (raw)
In-Reply-To: <99EB298E5D3A2C46BD744630B3FD093E9515D604B7@EXVMBX-1.intermedia-inc.net>
References: <99EB298E5D3A2C46BD744630B3FD093E9515D604B7@EXVMBX-1.intermedia-inc.net>

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



view thread (4+ messages)  latest in thread

Message-ID: <27257.1219236864@sss.pgh.pa.us>
Permalink:  ../27257.1219236864@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27257.1219236864@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, shripchenko@intermedia.net
  Subject: Re: pgsql do not handle NULL constants in the view
  In-Reply-To: <27257.1219236864@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox