Skip site navigation (1) Skip section navigation (2)

Re: System Date

From: "Milen A(dot) Radev" <milen(at)radev(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: System Date
Date: 2007-01-19 08:22:37
Message-ID: 45B07FCD.2090001@radev.net (view raw or flat)
Thread:
Lists: 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


In response to

pgsql-admin by date

Next:From: Vasu Kamma (vakamma)Date: 2007-01-19 08:30:46
Subject: Postgres installation on windows
Previous:From: Gregory S. WilliamsonDate: 2007-01-19 03:34:42
Subject: Re: Strange performance hit upgrading from 8.0.9 to 8.2.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group