Re: [REVIEW] Patch for cursor calling with named parameters

From: Royce Ausburn <royce(dot)ml(at)inomial(dot)com>
To: Yeb Havinga <yebhavinga(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [REVIEW] Patch for cursor calling with named parameters
Date: 2011-10-11 11:55:09
Message-ID: 29A8127B-BB37-40DC-8FB6-833710DAB22C@inomial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 08/10/2011, at 1:56 AM, Yeb Havinga wrote:

> Attach is v2 of the patch.
>
> Mixed notation now raises an error.
>
> In contrast with what I said above, named parameter related errors are thrown before any syntax errors. I tested with raising syntax errors first but the resulting code was a bit more ugly and the sql checking under a error condition (i.e. double named parameter error means there is one parameter in short) was causing serious errors.
>
> Documentation was also added, regression tests updated.

I've tested this patch out and can confirm mixed notation produces an error:

psql:plsqltest.sql:27: ERROR: mixing positional and named parameter assignment not allowed in cursor "cur1"
LINE 10: open cur1( param2 := 4, 2, 5);

Just one small thing: it'd be nice to have an example for cursor declaration with named parameters. Your patch adds one for opening a cursor, but not for declaring one.

Other than that, I think the patch is good. Everything works as advertised =)

--Royce

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2011-10-11 12:16:27 Re: index-only scans
Previous Message Dave Page 2011-10-11 11:18:33 Buildfarm git failures