Hi, ALL,
Is there a way to see if the query has been prepared already (in libpq)?
Trying to avoid a following scenario (pseudo-code):
[code]
int main()
{
test();
test();
}
void test()
{
PGresult *res = PQprepare( conn, "my query", "SELECT * FROM
my_table", /* rest of params */ );
PQclear( res );
}
[/code]
I presume there is a penalty for that even if the code succeeds.
Or is it better to run PQprepare for all known parameterized queries
in the very beginning of the program and just execute them when needed?
Thank you.