Sam Mason <sam@samason.me.uk> writes:
> On Fri, Nov 16, 2007 at 01:38:30AM -0500, Tom Lane wrote:
>> IIRC, it used to be restricted to a constant, a few revisions back.
> I'm amazed it supports anything more than a constant. The values are
> almost always going to come from external code, so there doesn't seem
> much point in doing anything else.
> I suppose with all the expression evaluation code already in PG,
> supporting what it currently does isn't hard.
Right. There's clearly some value in supporting a parameter ($n),
and once we do that, given the existing expression-evaluation
infrastructure, we might as well allow everything except sub-selects.
(Sub-selects would cost a bit more because the planner would have to
deal with 'em. Maybe not even a lot more ... I've not looked at it.)
regards, tom lane