Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using libpq to explain a prepared statement

19 views
Skip to first unread message

lish...@gmail.com

unread,
Jun 22, 2018, 2:47:20 PM6/22/18
to
Hi,

I am trying to send the following query to postgresql through libpq:

EXPLAIN (FORMAT json, COSTS false) EXECUTE \"" + prepared_statement_name + "\" ($1, $2)"

I tried to plug in the query to PQsendQueryParams, it reports the error "bind message supplies 2 parameters, but prepared statement “” requires 0"

Other than sending it as raw query.
Does anyone know how I could make PQsendQueryParams work with explain prepared_statement ?

Thanks,
Lishi

p.s. Using PQsendQueryPrepared to run the plain "prepared_statement_name" is working properly.
0 new messages