Re: function parameters

From: James Cloos <cloos(at)jhcloos(dot)com>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: function parameters
Date: 2006-09-04 03:38:34
Message-ID: m3wt8k8fn2.fsf@lugabout.jhcloos.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

>>>>> "RB" == Richard Broersma <rabroersma(at)yahoo(dot)com> writes:

JC> Is it possible for funtions to have named parameters rather than
JC> just positional parameters?

RB> I am not sure that every procedural language is the same, but with plpgsql:
RB> www.postgresql.org/docs/8.1/interactive/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIASES
RB> is seems that you can.

Thanks for that. I was hoping for something more akin to what perl
offers (passing a hash rather than an array). After reading that
bit of the docs, I suppose I could have the array take a pair of
arrays, one with the names and one with the values.

But it seems more likely I'll end up moving that logic out of the
sql and into the code generating and submitting the sql. That code
is expected to be the only code doing INSERTs, so it should still
be sufficiently robust for this project.

The reply and this reply have helped me get a better handle on what
I want, need and how to do it.

-JimC
--
James Cloos <cloos(at)jhcloos(dot)com> OpenPGP: 0xED7DAEA6

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message James Cloos 2006-09-04 03:41:35 Re: defaults referencing other columns?
Previous Message Richard Broersma Jr 2006-09-04 02:20:17 Re: Progress and Questions