pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen A. Radev <milen@radev.net>
To: pgsql-admin@postgresql.org
Subject: Re: System Date
Date: Fri, 19 Jan 2007 10:22:37 +0200
Message-ID: <45B07FCD.2090001@radev.net> (raw)
In-Reply-To: <FE0C41EEBEF01C47BF3A91F60669446804973251@PUNISHER.intra.infousa.com>
References: <FE0C41EEBEF01C47BF3A91F60669446804973246@PUNISHER.intra.infousa.com>
	<F4E6A2751A2823418A21D4A160B68988029EAA@fletch.stackdump.local>
	<FE0C41EEBEF01C47BF3A91F60669446804973251@PUNISHER.intra.infousa.com>

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




view thread (5+ messages)

Message-ID: <45B07FCD.2090001@radev.net>
Permalink:  ../45B07FCD.2090001@radev.net/
Also on:    postgresql.org/message-id/45B07FCD.2090001@radev.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: milen@radev.net
  Subject: Re: System Date
  In-Reply-To: <45B07FCD.2090001@radev.net>
  References: <FE0C41EEBEF01C47BF3A91F60669446804973246@PUNISHER.intra.infousa.com> <F4E6A2751A2823418A21D4A160B68988029EAA@fletch.stackdump.local> <FE0C41EEBEF01C47BF3A91F60669446804973251@PUNISHER.intra.infousa.com> <45B07FCD.2090001@radev.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox