WIP: Allow SQL-language functions to reference parameters by parameter name

From: Matthew Draper <matthew(at)trebex(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WIP: Allow SQL-language functions to reference parameters by parameter name
Date: 2011-03-25 19:33:24
Message-ID: 4D8CEE04.9000700@trebex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Attached is a WIP patch that allows SQL-language functions to reference
their parameters by name.

It uses p_post_columnref_hook, so potentially ambiguous references
prefer the column... that seems to make the most sense, both because it
avoids a backwards incompatibility, and it conforms with SQL's usual
notion of assuming you mean the "nearest" name.

It allows the parameter name to be qualified with the function name, for
when you really mean you want the parameter.

This being my first foray into the PostgreSQL source, I expect the code
is horribly wrong in a variety of ways. Other than that, the regression
tests I've been using are a slight modification of existing queries; I
imagine they should look measurably different.

And finally, conspicuously absent are the documentation changes that
will obviously need to accompany a real patch.

(This builds & passes `make check` on current HEAD, a4425e3)

Thanks!

Matthew

--
matthew(at)trebex(dot)net

Attachment Content-Type Size
sql-named-param-refs-v0.patch text/x-patch 10.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2011-03-25 19:44:38 Re: Set hint bits upon eviction from BufMgr
Previous Message Heikki Linnakangas 2011-03-25 19:32:02 Re: Set hint bits upon eviction from BufMgr