Hi all, I'm seeing a bit strange (some might say inconsistent) behaviour, possibly a bug. First, I prepare a statement by running the query: "PREPARE bar (int) AS (SELECT 1, $1, 3)" Then I try to use the generic libpq query function PQsendQueryParams with a query of "EXECUTE bar(2)" and I get back a result set with one record (1, 2, 3) in it. This is fine. But when I try to do the same but pas the 2 as a parameter, (I do "EXECUTE bar($1)" with $1 bound to "2"), I get an error: ERROR: bind message supplies 1 parameters, but prepared statement "" requires 0 This doesn't make much sense to me. It's the same error you get when trying to run a nonparameterized query like "SELECT 1" with $1 bound to anything. Does the query parser somehow miss the fact that there's a placeholder in the EXECUTE statement? I'm attempting to keep my Scheme library's API as small and simple as possible, so I'd like to avoid having a separate procedure for querying and one for executing prepared statements, considering there's also an SQL command for executing prepared statements. Is there a particular reason there are separate functions in libpq (aside from historical accident)? Cheers, Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general