Summary

postgresql: executing stored procedures with bind parameters fails

Metadata

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.

Changes and comments

[2011-06-19 15:08:48 UTC] sjamaan changed status from new to closed

[2011-06-19 15:08:48 UTC] sjamaan set resolution to fixed

[2011-06-19 15:08:48 UTC] sjamaan wrote:

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.

[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0

[2012-09-24 21:47:48 UTC] felix wrote:

Milestone 4.8.0 deleted