Re: defaults in a function

From: David Johnston <polobo(at)yahoo(dot)com>
To: "johnf(at)jfcomputer(dot)com" <johnf(at)jfcomputer(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: defaults in a function
Date: 2012-06-06 15:27:40
Message-ID: 51DDFD64-F1F6-478D-AAE2-4456AACD0601@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Jun 6, 2012, at 11:08, John Fabiani <johnf(at)jfcomputer(dot)com> wrote:

> Hi,
> In python when I create a method/function is set a default value for a passed value if one is not provided.
>
> def foo(self, event = None):
>
> In the above function if the second value is not passed a value of None is used as the default.
>
> Is this possible with plpgsql???
>
> Johnf
>

http://www.postgresql.org/docs/9.0/interactive/sql-createfunction.html

... param_n type DEFAULT value
OR
... param_n type = value

It is SQL DDL syntax and not specific to the language the function is written in.

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message John Fabiani 2012-06-07 23:17:34 using ordinal_position
Previous Message John Fabiani 2012-06-06 15:08:05 defaults in a function