Results 1 to 20 of 29

Thread: Access to PostgreSQL DB on a linux server

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    This is all hardcoded to qmake by the time of configure. I guess something went wrong with configure.. At least the prefix seems to be not what you intended to.
    J-P Nurmi

  2. #2
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Access to PostgreSQL DB on a linux server

    Ok. I will try other solutions.

    Thanks a lot for you help anyway

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    Oh, I almost forgot. You can always place the plugin into sqldrivers-subdir of the application binary.
    /path/to/app/binary
    /path/to/app/sqldrivers/libqsqlpsql.so
    J-P Nurmi

  4. #4
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Access to PostgreSQL DB on a linux server

    BINGO !!!

    It worked fine!!

    Thanks a lot ...you're great!

  5. #5
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Question Re: Access to PostgreSQL DB on a linux server

    Hi,

    I tried to run Robertos example but I can't find the libqsqlpsql files. I tried apt-cache search libsqlpsql with no result. My Qt-version is qt-4.3.3. In the path
    /usr/local/Trolltech/Qt-4.3.3/plugins/sqldrivers the only files is:
    libqsqlite.so libqsqlite.so.debug

    I also tried to search psql in synaptic and downloaded:
    postgresql-client
    postgresql-client-7.4
    postgresql-client-8.1
    libqt3-mt-psql

    I've got the libqsqlpsql.so but for qt3 so I still get the following errors when I'm running the program: (I tried to copy the libqsqlpsql.so for qt3 in the plugins/sqdrivers path for Qt4.33)

    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE
    Error while trying to open the DB

    How can I find the libqslpsql files for qt4.3.3 ?
    Any help is deaply apreciated!

    gQt

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    Quote Originally Posted by gQt View Post
    How can I find the libqslpsql files for qt4.3.3 ?
    If Ubuntu repositories don't offer such package you might have to download Qt sources and compile it yourself.
    J-P Nurmi

  7. #7
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Thanks!

    It looks like I have to configure and make Qt again. I can't find the Qt source code for Unix/linux available for downloads. When I type ./configure -help after downloading an unpacking the tar.gz-file I get these options:

    { two posts merged and ./configure -help output removed }

    I guess I have to enable sql-pluggins and the psql-dev must be installed before ./configure, make. But I can't find any source/src option here? (My linux distribution is Debian) Any help is greatly apreciated!
    Regards
    gQt
    Last edited by jpn; 11th March 2008 at 10:52. Reason: removed ./configure -help output

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    Quote Originally Posted by gQt View Post
    It looks like I have to configure and make Qt again. I can't find the Qt source code for Unix/linux available for downloads.
    ftp://ftp.trolltech.com/qt/source

    When I type ./configure -help after downloading an unpacking the tar.gz-file I get these options:
    Yes, anyone can run ./configure -help him/herself and get exactly the same output on X11.

    I guess I have to enable sql-pluggins and the psql-dev must be installed before ./configure, make. But I can't find any source/src option here?
    Yes, if you need SQL-plugins you either turn them on while building Qt by passing appropriate -sql-xxxxx options to configure OR you build the plugin manually after Qt has been built.
    J-P Nurmi

  9. #9
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Thanks for the links!

    If I understand I can go to the QtDir and type: make confclean, then run the ./configure script with the wright options for sql pluggins: -pluggin-sql-<driver>

    or build the QPSQL Plugin on Unix and Mac OS X manually
    (for psql)

    cd $QTDIR/src/plugins/sqldrivers/psql
    qmake -o Makefile "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro
    make

    My Qt-installation lack the src-dir under QTDIR and I can't find out how to download just the source. the link: ftp://ftp.trolltech.com/qt/source refers only to full Qt-installations, or am I wrong?

    Is it a configure option to specify that the src-dir should be downloaded too ? I can't see that from the ./configure -options

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    Well, you can't re-compile Qt if you installed a binary package from your distribution's repository (because you don't have the sources). So the option is to go grab a source package, for example qt-x11-opensource-src-4.3.4.tar.gz, and compile that by yourself.
    J-P Nurmi

  11. #11
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Thanks for replying!

    That's the strange thing, I downloaded the qt-x11-commercial-src-4.3.3.tar.gz and this file should also be a source package, but I could remove the installation and install the opensource version instead.

  12. #12
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Access to PostgreSQL DB on a linux server

    Quote Originally Posted by gQt View Post
    That's the strange thing, I downloaded the qt-x11-commercial-src-4.3.3.tar.gz and this file should also be a source package, but I could remove the installation and install the opensource version instead.
    Sorry, is this ... a question?
    J-P Nurmi

  13. #13
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Hi,

    The src-dir wasn't installed for some reason so I will copy the src-dir from the tar.gz-file to QtDir.

  14. #14
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: Access to PostgreSQL DB on a linux server

    Hi,
    Thanks!

    I had to copy the srcdir from the .tar.gz file, for som reason the srcdir was not installed. qmake detect all the files:
    qmake -o Makefile "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro

    But make gives a lot of errors and can't find libpq-fe.h. (This file is no where, tried locate). The errors in qsql_psql.cpp is probably because libpq-fe.h is missing.

    the postgresql-client-8.1, postgresql-dev and postgresql-server-dev-8.1 is installed

    I tried also to reconfigure qt. (make confclean first) and then
    ./configure -qt-sql-psql -plugin-sql-psql

Similar Threads

  1. Replies: 0
    Last Post: 16th April 2007, 12:18
  2. Replies: 1
    Last Post: 4th October 2006, 16:05
  3. Access MS .mdb file on Linux
    By iGoo in forum Qt Programming
    Replies: 3
    Last Post: 15th June 2006, 09:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.