1
mConn = PQconnectdb( conninfo );
const char* pQuery = "SELECT X FROM Y...";
PGresult* stmt = PQexec( mConn, pQuery );

can I do this?

char * original_query = Take( stmt );

thx

Mike
  • 1,008
  • 3
  • 12
  • 15

2 Answers2

1

See current_query() and its source code.

Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154
1

No, the PGresult structure does not contain that information. You need to save it yourself somehow.

Peter Eisentraut
  • 35,221
  • 12
  • 85
  • 90