Opened 10 years ago

Closed 10 years ago

Last modified 9 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:

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.

Change History (2)

comment:1 Changed 10 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 9 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.