Declaration of cursors with named parameters is already part of PostgreSQL (so it is possible to use the parameter names in the cursor query instead of $1, $2, etc.) and it also already documented with an example, just a few lines above the open examples. See curs3 onhttp://developer.postgresql.org/pgdocs/postgres/plpgsql-cursors.html