Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. the server version of this postgresql is unknown falling back to the client version

the server version of this postgresql is unknown falling back to the client version

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
c++postgresqlqt5.8.0
7 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThomasNeo
    wrote on 30 May 2023, 12:30 last edited by
    #1

    I am currently using postgresql 14.7 and QT 5.8.0. When i enter the command "postgres -V" or "psql -V" it both shows 14.7. Hence when i try to use VS2015 and run my code. It managed to establish connection to the database but in the console it keeps on giving this message whenever i execute the console application. "It gave me this error saying "the server version of this postgresql is unknown falling back to the client version" Is there any way to resolve this? Below is the following code.

    #include <QtSql>
    #include <QApplication>
    #include <cstdlib>
    #include <iostream>
    int main()
    {
    FILE* stream = _popen("pg_config --version", "r");
    char output[128];
    fgets(output, sizeof(output), stream);

    std::cout << "PostgreSQL version: " << output << std::endl;
    QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
    db.setHostName("localhost");
    db.setDatabaseName("test");
    db.setUserName("testtt");
    db.setPassword("password");
    bool ok = db.open();
    qDebug() << ok;
    qDebug() << db.connectionName();
    qDebug() << db.contains();
    return 0;
    }

    C 1 Reply Last reply 30 May 2023, 15:13
    0
    • T ThomasNeo
      30 May 2023, 12:30

      I am currently using postgresql 14.7 and QT 5.8.0. When i enter the command "postgres -V" or "psql -V" it both shows 14.7. Hence when i try to use VS2015 and run my code. It managed to establish connection to the database but in the console it keeps on giving this message whenever i execute the console application. "It gave me this error saying "the server version of this postgresql is unknown falling back to the client version" Is there any way to resolve this? Below is the following code.

      #include <QtSql>
      #include <QApplication>
      #include <cstdlib>
      #include <iostream>
      int main()
      {
      FILE* stream = _popen("pg_config --version", "r");
      char output[128];
      fgets(output, sizeof(output), stream);

      std::cout << "PostgreSQL version: " << output << std::endl;
      QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
      db.setHostName("localhost");
      db.setDatabaseName("test");
      db.setUserName("testtt");
      db.setPassword("password");
      bool ok = db.open();
      qDebug() << ok;
      qDebug() << db.connectionName();
      qDebug() << db.contains();
      return 0;
      }

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 30 May 2023, 15:13 last edited by
      #2

      @ThomasNeo said in the server version of this postgresql is unknown falling back to the client version:

      n" Is there any way to resolve this? Below is the following code.

      Simply ignore it - it just tells you that the plugin can't resolve the server version (because it doesn't know anything about 14.x in this old Qt version).

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      T 1 Reply Last reply 30 May 2023, 17:01
      2
      • C Christian Ehrlicher
        30 May 2023, 15:13

        @ThomasNeo said in the server version of this postgresql is unknown falling back to the client version:

        n" Is there any way to resolve this? Below is the following code.

        Simply ignore it - it just tells you that the plugin can't resolve the server version (because it doesn't know anything about 14.x in this old Qt version).

        T Offline
        T Offline
        ThomasNeo
        wrote on 30 May 2023, 17:01 last edited by
        #3

        @Christian-Ehrlicher Will it affect any functionality of the database since the old Qt version doesnt know anything about this 14.x?

        C 1 Reply Last reply 30 May 2023, 17:03
        0
        • T ThomasNeo
          30 May 2023, 17:01

          @Christian-Ehrlicher Will it affect any functionality of the database since the old Qt version doesnt know anything about this 14.x?

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 30 May 2023, 17:03 last edited by
          #4

          @ThomasNeo said in the server version of this postgresql is unknown falling back to the client version:

          Will it affect any functionality of the database since the old Qt version doesnt know anything about this 14.x?

          No, as it says it uses the version from the postgresql client library which seems to be suitable.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          T 1 Reply Last reply 30 May 2023, 17:14
          0
          • C Christian Ehrlicher
            30 May 2023, 17:03

            @ThomasNeo said in the server version of this postgresql is unknown falling back to the client version:

            Will it affect any functionality of the database since the old Qt version doesnt know anything about this 14.x?

            No, as it says it uses the version from the postgresql client library which seems to be suitable.

            T Offline
            T Offline
            ThomasNeo
            wrote on 30 May 2023, 17:14 last edited by
            #5

            @Christian-Ehrlicher Alright. Thanks a lot Christian. Can i ask if i upgrade my qt, will it remove this message? if so what qt version would you recommend me to use.

            C 1 Reply Last reply 30 May 2023, 17:17
            0
            • T ThomasNeo
              30 May 2023, 17:14

              @Christian-Ehrlicher Alright. Thanks a lot Christian. Can i ask if i upgrade my qt, will it remove this message? if so what qt version would you recommend me to use.

              C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 30 May 2023, 17:17 last edited by
              #6

              It should be fixed with Qt 5.9.3 when the parsing for the new numbering scheme of PostgreSQL was added.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              T 1 Reply Last reply 31 May 2023, 06:09
              0
              • C Christian Ehrlicher
                30 May 2023, 17:17

                It should be fixed with Qt 5.9.3 when the parsing for the new numbering scheme of PostgreSQL was added.

                T Offline
                T Offline
                ThomasNeo
                wrote on 31 May 2023, 06:09 last edited by
                #7

                @Christian-Ehrlicher Yup.. it worked when i upgraded my Qt version. Thanks a lot.

                Just for education purposes, can i ask lets say if i am still using qt 5.8.0 and i wish to remove this message. Is there a way to do that? I believe this message is caused by this qt sqldriver file called qsql_psql.cpp. So I tried to remove the code that prompts this message in qsql_psql.cpp file and it didnt work when i run my application.

                1 Reply Last reply
                0

                3/7

                30 May 2023, 17:01

                • Login

                • Login or register to search.
                3 out of 7
                • First post
                  3/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved