pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rod Taylor <rbt@rbt.ca>
Cc: Avi Schwartz <avi@CFFtechnologies.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: generic return for functions
Date: Sun, 01 Jun 2003 11:46:47 -0400
Message-ID: <26866.1054482407@sss.pgh.pa.us> (raw)
In-Reply-To: <1054470071.11968.115.camel@jester>
References: <47F83F6F-93EF-11D7-ACB0-000393AE5044@CFFtechnologies.com>
	<1054470071.11968.115.camel@jester>

Rod Taylor <rbt@rbt.ca> writes:
>> thing that causes me some minor grief is the fact that currently you=20
>> cannot have default values to function parameters, a feature we use a=20
>> lot.

> fn(integer, integer, integer default 32)
> select fn(integer, integer); <- Third argument would be '32'?
> When PostgreSQL gets named parameters the above probably makes sense to
> add.

> A TODO item?

That isn't ever going to happen.  We have enough difficulty resolving
overloaded functions as it is.  If we couldn't even be sure how many
arguments there were supposed to be, it'd become completely intractable.

You can however achieve similar effects at the user level by adding
auxiliary functions: declare fn(int,int) as a one-line SQL function
that calls fn($1, $2, 32).

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <26866.1054482407@sss.pgh.pa.us>
Permalink:  ../26866.1054482407@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26866.1054482407@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rbt@rbt.ca, avi@CFFtechnologies.com, pgman@candle.pha.pa.us
  Subject: Re: generic return for functions
  In-Reply-To: <26866.1054482407@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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