Re: Declaring timestamp variables in function - Mailing list pgsql-novice

From Tom Lane
Subject Re: Declaring timestamp variables in function
Date
Msg-id 26278.1299799646@sss.pgh.pa.us
Whole thread Raw
In response to Declaring timestamp variables in function  (Laurent <lduperval@gmail.com>)
List 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 by date:

Previous
From: Laurent
Date:
Subject: Declaring timestamp variables in function
Next
From: Jayadevan M
Date:
Subject: Re: psql in postgres 9.0.3 not accepting password