Patch - Reference Function Parameters by Name

From: George Gensure <werkt0(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Patch - Reference Function Parameters by Name
Date: 2009-11-18 14:57:07
Message-ID: b47db0340911180657k4faa8288i1679f94b1f223452@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Attached is a patch to perform parameter reference lookups by name in
the body of functions. I'm hesitant to put it in for the commitfest
as is, without a couple of questions posed to the group:

1. palloc needs no free? I suppose this is a general knowledge
question, but it seemed to be the case after trying to look for
deallocation
2. I inserted myself more than I had expected along the road from SQL
to columnref_hook, and I'm not sure all of those lookups of parameter
names and function name are required.
3. Since it was mentioned in an earlier email that the <function
name>.<parameter name> syntax was desired, I went ahead and added
that, but it required another passthrough as indicated in 2
4. I made a judgement call in terms of resolution: if the
columnref_hook for param-by-name resolution is called with a non-null
node (meaning a column was already found), we avoid being an ambiguous
reference, and prefer the column already found.

Passes all tests in make check, and I'll add some tests for this after
I get feedback for the above items.

Regards,
-George

Attachment Content-Type Size
param_names.patch application/octet-stream 22.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-18 15:18:34 Re: UTF8 with BOM support in psql
Previous Message Oleg Bartunov 2009-11-18 14:47:11 Re: Very bad FTS performance with the Polish config