Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

QT Postgres driver no go

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
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

PostPosted: Tue Apr 12, 2005 9:50 pm    Post subject: QT Postgres driver no go Reply with quote

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
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Thu Apr 14, 2005 10:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Fri Apr 15, 2005 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Fri Apr 15, 2005 6:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
nordle
LXF regular


Joined: Fri Apr 08, 2005 10:56 pm
Posts: 1500

PostPosted: Fri Apr 15, 2005 10:45 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Sat Apr 16, 2005 3:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Wed Apr 20, 2005 8:17 pm    Post subject: Reply with quote

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 user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast