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