Patch - Reference Function Parameters by Name - Mailing list pgsql-hackers

From George Gensure
Subject Patch - Reference Function Parameters by Name
Date
Msg-id b47db0340911180657k4faa8288i1679f94b1f223452@mail.gmail.com
Whole thread Raw
Responses Re: Patch - Reference Function Parameters by Name
List 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

pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Very bad FTS performance with the Polish config
Next
From: Tom Lane
Date:
Subject: Re: UTF8 with BOM support in psql