Patch - Reference Function Parameters by Name
George Gensure <werkt0@gmail.com>
From: George Gensure <werkt0@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2009-11-18T14:57:07Z
Lists: pgsql-hackers
Attachments
- param_names.patch (application/octet-stream) patch
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