| View previous topic :: View next topic |
| Author |
Message |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Tue Apr 12, 2005 9:50 pm Post subject: QT Postgres driver no go |
|
|
Does anybody know if the --qt-3.3.3 QSQLPSQL Postgres driver-- works with Postgres 8.0.1?
I am revampimg an old app which used Postgres 7.? and an earlier version of QT but I cannot get the two newer versions to connect. |
|
| Back to top |
|
 |
nordle LXF regular

Joined: Fri Apr 08, 2005 10:56 pm Posts: 1497
|
Posted: Thu Apr 14, 2005 10:59 pm Post subject: |
|
|
Should work fine, mine was compiled against 8.0.0rc1 and works, I would have thought it would be the same though.
Stupid question, but is 8.0.1 setup correctly, can you use odbc or jdbc to connect to it? |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Fri Apr 15, 2005 6:01 pm Post subject: |
|
|
Yup, I can connect ok with anything except the qt driver.
I recompiled qt from source but the postgres driver did not compile because some source header files seemed to be in the wrong location. After trying to fix this my brain is now addled so I have wiped everything and started again.GCC is happily clonking away in the background recompiling qt, so, in about 2 hours I will be ready to try again. I will report any further developments. |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Fri Apr 15, 2005 6:09 pm Post subject: |
|
|
| I didn't make myself very clear above. I am trying to do this on a Slack 10.1 system which does not appear to have a ready compiled qt postgres driver hence the recompilation. As a temporary measure I shifted the whole lot to a Suse system which does have the driver and that is the one I could not get to work, so I am going back to the Slack system to try again. |
|
| Back to top |
|
 |
nordle LXF regular

Joined: Fri Apr 08, 2005 10:56 pm Posts: 1497
|
Posted: Fri Apr 15, 2005 10:45 pm Post subject: |
|
|
| wiz wrote: | | I didn't make myself very clear above. I am trying to do this on a Slack 10.1 system which does not appear to have a ready compiled qt postgres |
ahhh, ok, no problem. Im running Slack 10.1 with the qt postgres driver after compiling it because its not there as standard.
The file it moaned about was probably libpq-fe.h, libpq.h, or postgres.h or similar.
You DONT have to compile all of qt to get the driver up and running. I did this a while ago, so am a bit sketchy on the exact details.
1. When installing postgresql try putting the source in /usr/local/pgsql/src, then compiling with a prefix of /usr/local/pgsql
2. Add /usr/local/pgsql/lib to /etc/ld.so.conf and run ldconfig
3. Copy just the qt source directory (src) and everything below it eg qt-x11-free-3.x.x/src to /usr/lib/qt/src
4. This is the install procedure, takes seconds.
I've put my example of assuming the pgsql source is in /usr/local/pgsql/src below
http://doc.trolltech.com/3.3/sql-driver.html
cd $QTDIR/plugins/src/sqldrivers/psql
qmake -o Makefile "INCLUDEPATH+=/usr/local/pgsql/src/postgresql-8.0.2/src/include /usr/local/pgsql/src/postgresql-8.0.2/src/interfaces/libpq" "LIBS+=-L/usr/lib -lpq" psql.pro
make
Then you could checkinstall make install it to create a package for use later on, qt sql drivers last for ages before needing a recompile, I was still using 7.4.1 compiled from slack 9.1 with 8.0.0
Sorted....hopefully  |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Sat Apr 16, 2005 3:58 pm Post subject: |
|
|
| Thanks for your help. Unfortunately, due to time limits I resorted to the dark side & did the whole job with C Builder but I will return to this as soon as I can |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Wed Apr 20, 2005 8:17 pm Post subject: |
|
|
Heeeey! we're done. With a bit more time and a good look at your instructions and the link above, the driver compiled in about 5 seconds and my program connected straight away. I just needed to shift the postgres source up the directory tree one level.
It doesn't explain why the Suse system wont connect though but i'll leave that for someone else. I'm back with Slack & I'm happy:-) |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|