pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
defaults in a function
2+ messages / 2 participants
[nested] [flat]

* defaults in a function
@ 2012-06-06 15:08 John Fabiani <johnf@jfcomputer.com>
  2012-06-06 15:27 ` Re: defaults in a function David Johnston <polobo@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: John Fabiani @ 2012-06-06 15:08 UTC (permalink / raw)
  To: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: defaults in a function
  2012-06-06 15:08 defaults in a function John Fabiani <johnf@jfcomputer.com>
@ 2012-06-06 15:27 ` David Johnston <polobo@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: David Johnston @ 2012-06-06 15:27 UTC (permalink / raw)
  To: johnf@jfcomputer.com <johnf@jfcomputer.com>; +Cc: pgsql-sql

On Jun 6, 2012, at 11:08, John Fabiani <johnf@jfcomputer.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.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-06-06 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06 15:08 defaults in a function John Fabiani <johnf@jfcomputer.com>
2012-06-06 15:27 ` David Johnston <polobo@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox