Summary
postgresql: executing stored procedures with bind parameters fails
Metadata
- Id: e1ac24906d1e161cd9e62eedb334e459d96bdb0b
- Trac id: 609
- Type: defect
- Reporter: syn
- Owner: sjamaan
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2011-06-15 23:20:07 UTC
- Keywords: postgresql
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