Error when assigning default value for function parameter

From: Gert <gert(dot)conradie(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Error when assigning default value for function parameter
Date: 2009-08-04 17:16:27
Message-ID: 55aee206-ffe8-4f4c-9cca-b3f440968304@c2g2000yqi.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm a bit in the dark:
I use Windows XP
I use pgAdmin ver 1.8.4
I use PostGres 8.3.6

All the documentation points out that it is allowed to assign default
values to parameters, but I get a syntax error here.

I would appreciate feedback.

CREATE OR REPLACE FUNCTION myfunc(a integer , b integer DEFAULT 100)
RETURNS INTEGER AS $$
select 200;
$$ language sql;

ERROR: syntax error at or near "DEFAULT"
LINE 1: ...TE OR REPLACE FUNCTION ___myfunc(a int, b integer DEFAULT
10...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edward Amsden 2009-08-04 17:54:39 ECPG: insert array?
Previous Message Bill Moran 2009-08-04 16:51:55 Re: Does derby have an embedded Mode like Derby ?