Re: Declaring timestamp variables in function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Declaring timestamp variables in function
Дата
Msg-id 26278.1299799646@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Declaring timestamp variables in function  (Laurent <lduperval@gmail.com>)
Список pgsql-novice
Laurent <lduperval@gmail.com> writes:
> CREATE or replace FUNCTION updateDates() RETURNS void AS $$
> declare
>     currentDate timestamp(3);
> BEGIN
> currentDate =  := round_time(current_date);
>  ...
> -- here I update my date
> END;
> $$ LANGUAGE SQL;

> The problem is that my currentDate declaration always generates an
> error:

> ********** Error **********

> ERROR: syntax error at or near "timestamp"

The problem's at the other end of that command :-(.  You need to
say language plpgsql, not language sql.

            regards, tom lane

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

Предыдущее
От: Laurent
Дата:
Сообщение: Declaring timestamp variables in function
Следующее
От: Jayadevan M
Дата:
Сообщение: Re: psql in postgres 9.0.3 not accepting password