WIP: Allow SQL-language functions to reference parameters by parameter name
Matthew Draper <matthew@trebex.net>
From: Matthew Draper <matthew@trebex.net>
To: pgsql-hackers@postgresql.org
Date: 2011-03-25T19:33:24Z
Lists: pgsql-hackers
Attachments
- sql-named-param-refs-v0.patch (text/x-patch) patch v0
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@trebex.net