Re: [SQL] Mail about typecast

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] Mail about typecast
Дата
Msg-id 22648.929455637@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] Mail about typecast  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Список pgsql-sql
Herouth Maoz <herouth@oumail.openu.ac.il> writes:
> At 16:39 +0300 on 15/06/1999, Tom Lane wrote:
>> select date_part('epoch','12 hours'::timespan) AS float4;

> Probably missing a CAST keyword here, isn't it?

My mistake, this should have been

select CAST (date_part('epoch','12 hours'::timespan) AS float4);

(the parens are required too).  The first way just relabels the
output column, it doesn't actually change the datatype :-(
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Herouth Maoz
Дата:
Сообщение: Re: [SQL] Mail about typecast
Следующее
От: "Arendt, Volker"
Дата:
Сообщение: subscribe pgsql-sql