Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-4294

getPSQLVersion() may print misleading information if it fails to find the server version

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bilking Bill King
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes