Re: inserting a NULL timestamp

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: inserting a NULL timestamp
Дата
Msg-id 4D921262.9070508@pinpointresearch.com
обсуждение исходный текст
Ответ на inserting a NULL timestamp  (Robert Poor <rdpoor@gmail.com>)
Ответы Re: inserting a NULL timestamp  (Robert Poor <rdpoor@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Robert Poor
Дата:
Сообщение: inserting a NULL timestamp
Следующее
От: Robert Poor
Дата:
Сообщение: Re: inserting a NULL timestamp