Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > pgsql.general > #29

using libpq to explain a prepared statement

Newsgroups pgsql.general
Date 2018-06-22 11:47 -0700
Message-ID <2f822569-c4ff-4a7a-a52f-5e292dd3618e@googlegroups.com> (permalink)
Subject using libpq to explain a prepared statement
From lishij91@gmail.com

Show all headers | View raw


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.

Back to pgsql.general | Previous | Next | Find similar


Thread

using libpq to explain a prepared statement lishij91@gmail.com - 2018-06-22 11:47 -0700

csiph-web