Received: from mta4-rme.xtra.co.nz (mta4-rme.xtra.co.nz [203.96.92.15]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2DBqgx04217 for ; Tue, 13 Mar 2001 06:52:44 -0500 (EST) (envelope-from csawtell@xtra.co.nz) Received: from berty ([210.55.121.4]) by mta4-rme.xtra.co.nz with SMTP id <20010313115240.TJBU12559245.mta4-rme.xtra.co.nz@berty> for ; Wed, 14 Mar 2001 00:52:40 +1300 Content-Type: text/plain; charset="iso-8859-1" From: Christopher Sawtell Organization: At Home To: pgsql-sql@postgresql.org Subject: my pgsql error? Date: Wed, 14 Mar 2001 00:53:05 +1300 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01031400530600.00996@berty> Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/250 X-Sequence-Number: 1909 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 ' declare t 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 Sawtell CELL PHONE 021 257 4451 ICQ UIN 45863470 EMAIL csawtell @ xtra . co . nz CNOTES 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 <<--