Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#609 closed defect (fixed)

postgresql: executing stored procedures with bind parameters fails

Reported by: Moritz Heidkamp Owned by: sjamaan
Priority: minor Milestone: 4.9.0
Component: extensions Version: 4.7.x
Keywords: postgresql Cc:
Estimated difficulty:


Executing a stored procedure with bind parameters in argument position like this:

(query conn "EXECUTE foo($1, $2)" 100 2)

Leads to an error like this:

ERROR: bind message supplies 2 parameters, but prepared statement "" requires 0

Adding explicit types after the parameters (like $1::int) doesn't work either.

Change History (2)

comment:1 Changed 13 years ago by sjamaan

Resolution: fixed
Status: newclosed

This is actually an inconsistency/bug in postgresql (see this mail exchange).

It is now possible (postgresql trunk) to provide the name of a prepared statement (which is what EXECUTE runs, not stored procedures) as a symbol to query instead of a string query.

comment:2 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.