Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.5.2
-
None
Description
getPSQLVersion() returns the database server version the driver is connecting to, and calls
PGresult* result = PQexec(connection, "select version()");
to retrieve version information from the database. getPSQLVersion() defaults to version 6, and prints out the following warning message if the server version is less than 7.1:
"This version of PostgreSQL is not supported and may not work."
However, if PQexec() itself fails (result status is not PGRES_COMMAND_OK or PGRES_TUPLES_OK), there is no indication as to what went wrong. The QPSQL plugin uses the default version 6, and the warning message is printed out, even if the driver tried to connect to a database version 7.1 or higher.
1. QPSQL/getPSQLVersion() should provide accurate warnings or error messages when PQexec() fails.
2. The warning message when the server version is less than 7.1 should also include the minimum supported server version, and it would be nice if it also included the server version of the database it is connected to.