Re: inserting a NULL timestamp - Mailing list pgsql-novice

From Steve Crawford
Subject Re: inserting a NULL timestamp
Date
Msg-id 4D921262.9070508@pinpointresearch.com
Whole thread Raw
In response to inserting a NULL timestamp  (Robert Poor <rdpoor@gmail.com>)
Responses Re: inserting a NULL timestamp
List pgsql-novice
On 03/29/2011 10:03 AM, Robert Poor wrote:
> .
>
> # INSERT INTO service_bills (cost,start_time)
>              SELECT candidates.*
>                FROM (SELECT 2.3 AS cost, NULL AS start_time) AS candidates;
>
> This, though, raises an error:
>
> # ERROR:  failed to find conversion function from unknown to timestamp
> without time zone
>
> So: What's so different about the second version?

It's the select part that is causing your trouble. Try casting the null
to a timestamp:
...as cost, null::timestamp as start_time...

Cheers,
Steve


pgsql-novice by date:

Previous
From: Robert Poor
Date:
Subject: inserting a NULL timestamp
Next
From: Robert Poor
Date:
Subject: Re: inserting a NULL timestamp