HASHes [was Re: Calling PL functions with named parameters]

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: HASHes [was Re: Calling PL functions with named parameters]
Date: 2004-08-16 16:01:03
Message-ID: 20040816160103.GG17886@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 13, 2004 at 07:12:14PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <decibel(at)decibel(dot)org> writes:
> > IOW, their function resolution code treats a(int, int default 0)
> > as being equivalent to a(int) and a(int, int).
>
> So you are willing to prohibit a(int) from existing in parallel with
> a(int, int-with-a-default) ?
>
> I'll be interested to see the unique-index scheme for pg_proc to
> enforce that ;-)
>
> However this does point up the fact that there already *is* a way to
> accomplish the task, which is just to create some helper function(s)
> to supply the default(s). Perhaps we can leave it at that for the
> time being, and concentrate on adding real new functionality.

That'd be neat. :)

Here's another possibility. PostgreSQL has already "gone there" with
multidimensional ARRAYs, and thanks, Joe! What about making HASHes a
first-class object? This would do two controversial things (that I've
thought of).

1. Use the => operator, removing it from the pool of unused
operators.

2. Possibly encourage people to Do The Wrong Thing(TM).

What we'd get for the effort, though, is tighter integration with
languages that have some kind of associative array structure, which is
to say all the "scripting" languages, and an ability to deal with
data structures to and from queries that more closely matches what the
middleware/front end needs to do.

How big a can of worms am I opening here?

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-16 16:07:13 Re: HASHes [was Re: Calling PL functions with named parameters]
Previous Message Josh Berkus 2004-08-16 15:59:17 Re: Postgresql.conf Documentation change