Here's a patch that allows parameterized queries to be used in a DECLARE
CURSOR statement.
Previously, the DECLARE would succeed but any FETCHes would fail as the
parameter values supplied to DECLARE were not propagated to the portal
it created. This patch adds that propagation. See
http://archives.postgresql.org/pgsql-hackers/2004-07/msg01047.php for
discussion.
I've tested the V3 protocol and SQL function paths by hand. The SPI path
hasn't been specifically tested but the regression tests appear happy.
-O