Opening a plpgsql cursor parameter by name - Mailing list pgsql-hackers

From Yeb Havinga
Subject Opening a plpgsql cursor parameter by name
Date
Msg-id [email protected]
Whole thread Raw
Responses Re: Opening a plpgsql cursor parameter by name
List pgsql-hackers
Hello list,

We intend to implement $subject, so instead of

mycursor CURSOR (myparm text) IS SELECT myparm;
OPEN mycursor('A');

it would be possible to do

OPEN mycursor(myparm := 'A');

The idea is to

* in pl_exec.exec_stmt_forc, detect if a positional parameter or named 
parameter is used.
* if named, use plpgsql_ns_lookup to find the cursur arguments position 
in the plpgsql name space.
* normal processing for the found position from here.

Mixing named and positional could probably be made to work as well.

Does this approach sound reasonable?

regards,
Yeb Havinga & Willem Dijkstra



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: snapshot generation broken
Next
From: Magnus Hagander
Date:
Subject: Re: snapshot generation broken