Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group