Re: Extract Function

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Extract Function
Дата
Msg-id 20040326105524.J73227@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Extract Function  ("Derrick Betts" <Derrick@Blue-Axis.com>)
Список pgsql-novice
On Fri, 19 Mar 2004, Derrick Betts wrote:

> I am trying to use the EXTRACT function in pl/pgsql and running into a problem.
>
> This is the command:
>
> SELECT EXTRACT(EPOCH FROM TIMESTAMP variable_name) INTO Temp;
>
> The variable_name is of type text (I've also tried it as type
> timestamp), but the parser breaks when it attempts to perform this
> function.  It works great when I substitute the variable_name with
> '2004-1-10 00:00:00' , however, when I use a variable, it doesn't.

TIMESTAMP <foo> is meant for timestamp literals.  If you want to
convert a value from one type to another, you probably want something
like CAST(variable_name AS TIMESTAMP)

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

Предыдущее
От: joe@tsolucio.com (Joe Bordes)
Дата:
Сообщение: Re: how to test string against regular expression contained in postgresql database field?
Следующее
От: Aarni Ruuhimäki
Дата:
Сообщение: Re: Images in Database