Re: Error when assigning default value for function parameter

From: Frank Heikens <frankygoestorio(at)mac(dot)com>
To: Gert <gert(dot)conradie(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Error when assigning default value for function parameter
Date: 2009-08-04 18:43:37
Message-ID: E29C2BDB-3273-4078-8FEB-73062F85B44D@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can't use default values in a function, that option is available
as of version 8.4. You are using 8.3.

Regards,
Frank

Op 4 aug 2009, om 19:16 heeft Gert het volgende geschreven:

> 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...
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Frank Heikens
frankheikens(at)mac(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2009-08-04 18:47:09 Re: Error when assigning default value for function parameter
Previous Message Guy Rouillier 2009-08-04 18:28:22 Re: Does derby have an embedded Mode like Derby ?