Re: function parameters - Mailing list pgsql-novice

From James Cloos
Subject Re: function parameters
Date
Msg-id m3wt8k8fn2.fsf@lugabout.jhcloos.org
Whole thread Raw
In response to Re: function parameters  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-novice
>>>>> "RB" == Richard Broersma <rabroersma@yahoo.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@jhcloos.com>         OpenPGP: 0xED7DAEA6



pgsql-novice by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Progress and Questions
Next
From: James Cloos
Date:
Subject: Re: defaults referencing other columns?