Re: System Date - Mailing list pgsql-admin

From Milen A. Radev
Subject Re: System Date
Date
Msg-id 45B07FCD.2090001@radev.net
Whole thread Raw
In response to Re: System Date  ("Negandhi, Nishith" <Nishith.Negandhi@infoUSA.com>)
List pgsql-admin
Negandhi, Nishith написа:
> Hi Thanx..one more help.
> I am creating a function that will retuen the current systemdate.
>
> CREATE FUNCTION "CreateDate"() RETURNS date AS
> 'select now();'
> LANGUAGE 'plpgsql';
>
> However, I get the error:
>
> ERROR:  syntax error at or near "select" at character 51
>
> Any suggestions .??
>
[...]


CREATE FUNCTION "CreateDate"() RETURNS date AS
'select CURRENT_DATE;'
LANGUAGE SQL;

(more info here -
http://www.postgresql.org/docs/current/static/xfunc-sql.html)


Although I fail to see the usefulness of such a function.


--
Milen A. Radev

pgsql-admin by date:

Previous
From: "Gregory S. Williamson"
Date:
Subject: Re: Strange performance hit upgrading from 8.0.9 to 8.2.1
Next
From: "Vasu Kamma \(vakamma\)"
Date:
Subject: Postgres installation on windows