#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: |
Description
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.
Note: See
TracTickets for help on using
tickets.
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.