my pgsql error? - Mailing list pgsql-sql

From Christopher Sawtell
Subject my pgsql error?
Date
Msg-id 01031400530600.00996@berty
Whole thread Raw
Responses Re: my pgsql error?  (Christof Glaser <gcg@gl.aser.de>)
List pgsql-sql
Please could a kind soul help me with this.
I can't find _any_ - however cryptic - docs about plpgsql.

create function nice_date(date) returns varchar as 'declaret alias for $1;d text;m text;y text;begin day :=
rtrim(to_char(\'t\'::timestamp,\'Day\')); month := rtrim(to_char(\'t\'::timestamp, \'DD Month\')); year :=
rtrim(to_char(\'t\'::timestamp,\'YYYY\' )); nd := d || m || y;end;return nd;
 
end;' language 'plpgsql';

It seems to load ok, but on exection I get this message.

chris=# select nice_date(date('today'));
NOTICE:  plpgsql: ERROR during compile of nice_date near line 12
ERROR:  parse error at or near "return" 

Please, what am I doing wrong?

-- 
Sincerely etc.,
NAME       Christopher SawtellCELL PHONE 021 257 4451ICQ UIN    45863470EMAIL      csawtell @ xtra . co . nzCNOTES
ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz
-->> Please refrain from using HTML or WORD attachments in e-mails to me 
<<--



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Poor document!!
Next
From: juerg.rietmann@pup.ch
Date:
Subject: copy a record from one table to another (archive)