Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

Connecting to a Postgres Database

16 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dave Coventry

Hi,

I'm using a windows machine (XP) running my app written with Lazarus and trying to connect to a Postgres Server.

Whenever I turn the Connected field on my PQConnection component, I get an error saying that it cannot find PostgreSQL client and referencing libpq.dll.

Does anyone know what's happening?

Do I need a client to start the connection with the server?

Reply by email

zeljko
to Dave Coventry
Dave Coventry wrote 12 lines
Hi, I'm using a windows machine (XP) running my app written with Lazarus and trying to connect to a Postgres Server. Whenever I turn the Connected field on my PQConnection component, I get an error saying that it cannot find PostgreSQL client and referencing libpq.dll. Does anyone know what's happening? Do I need a client to start the connection with the server?

find libpq.dll/libpq8X.dll somewhere and copy it to C:\Windows\System32 (probably you can find libpq.dll in your windows postgres installation)

_______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Dave Coventry
to zeljko

Hi.

I don't HAVE a windows postgres installation.

Do you have copies of the files? The best I could do was to was a libpq.dll from v7.0.

Why are they needed, anyway? I don't see any mention of their requirement in the wiki(s).

I'm not actually convinced that this is the problem; how do I test to see if the Ubuntu server is allowing Postgres transactions?

Many thanks,

Dave Coventry

zeljko wrote 26 lines
On Sunday 25 May 2008 17:08, Dave Coventry wrote: > Hi, > > I'm using a windows machine (XP) running my app written with Lazarus > and trying to connect to a Postgres Server. > > Whenever I turn the Connected field on my PQConnection component, I > get an error saying that it cannot find PostgreSQL client and > referencing libpq.dll. > > Does anyone know what's happening? > > Do I need a client to start the connection with the server? find libpq.dll/libpq8X.dll somewhere and copy it to C:\Windows\System32 (probably you can find libpq.dll in your windows postgres installation) > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

zeljko
to Dave Coventry
Dave Coventry wrote 6 lines
Hi. I don't HAVE a windows postgres installation. Do you have copies of the files? The best I could do was to was a libpq.dll from v7.0.

no, have only linux libpq.so .... so google is your friend. I think that you can find it in zeoslib downloads section.

Why are they needed, anyway? I don't see any mention of their requirement in the wiki(s).

well, then somebody must add requirement for libpq.dll , it cannot work without it.

I'm not actually convinced that this is the problem; how do I test to see if the Ubuntu server is allowing Postgres transactions?

postgres transactions ? I don't understand.
If U can connect to XXX server usualy at port 5432 then it works, or it returns exception like : Is the server XXXXX running on port 5432 ? etc ...

Show quoted text 37 lines
Many thanks, Dave Coventry On Sun, May 25, 2008 at 5:28 PM, zeljko wrote: > On Sunday 25 May 2008 17:08, Dave Coventry wrote: >> Hi, >> >> I'm using a windows machine (XP) running my app written with Lazarus >> and trying to connect to a Postgres Server. >> >> Whenever I turn the Connected field on my PQConnection component, I >> get an error saying that it cannot find PostgreSQL client and >> referencing libpq.dll. >> >> Does anyone know what's happening? >> >> Do I need a client to start the connection with the server? > > find libpq.dll/libpq8X.dll somewhere and copy it to C:\Windows\System32 > (probably you can find libpq.dll in your windows postgres installation) > >> _______________________________________________ >> Lazarus mailing list >> >> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Damien Gerard
to Dave Coventry: I'm using a windows machine (XP) running my app written with Lazarus and trying to…

Le May 25, 2008 ? 5:08 PM, Dave Coventry a ?crit :

Show quoted text 9 lines
Hi, I'm using a windows machine (XP) running my app written with Lazarus and trying to connect to a Postgres Server. Whenever I turn the Connected field on my PQConnection component, I get an error saying that it cannot find PostgreSQL client and referencing libpq.dll.

Under Windows you need those files when working with the postgres library :
total 2.9M
-rw-r--r-- 1 milipili staff 24K 2008-02-27 16:36 comerr32.dll -rw-r--r-- 1 milipili staff 512K 2008-02-27 16:36 krb5_32.dll -rw-r--r-- 1 milipili staff 1.1M 2008-02-27 16:36 libeay32.dll -rw-r--r-- 1 milipili staff 896K 2008-02-27 16:36 libiconv-2.dll -rw-r--r-- 1 milipili staff 50K 2008-02-27 16:36 libintl-2.dll -rw-r--r-- 1 milipili staff 183K 2008-02-27 16:36 libpq.dll -rw-r--r-- 1 milipili staff 196K 2008-02-27 16:36 ssleay32.dll

However I have not use yet postgres with lazarus but I can make you an archive if needed

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email

Dave Coventry
to Damien Gerard
Damien Gerard wrote
However I have not use yet postgres with lazarus but I can make you an archive if needed

Hi Damien,

That would be great. I have googled quite a bit, but only come up with the 7.0 version of libpq.dll

What would be the requirement be if I were to port my app to linux?

Reply by email

Jalal

Yes, you need the client libraries to connect to the PostgreSQL database server.

The PostgreSQL database access provided by the FreePascal team depends on the client libraries ( libpq and related ) supplied by the PostgreSQL team.

If you don't have them already from another PostgreSQL download you might consider pgAdmin, a nice administration tool which includes these DLLs too.

Earlier message 20 lines
From: "Dave Coventry" To: Date: Sun, 25 May 2008 17:08:05 +0200 Subject: [Lazarus] Connecting to a Postgres Database Hi, I'm using a windows machine (XP) running my app written with Lazarus and trying to connect to a Postgres Server. Whenever I turn the Connected field on my PQConnection component, I get an error saying that it cannot find PostgreSQL client and referencing libpq.dll. Does anyone know what's happening? Do I need a client to start the connection with the server? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080525/a14e4dbd/attachment-0001.html

Reply by email

Dave Coventry
to zeljko: no, have only linux libpq.so .... so google is your friend. I think that you can find it…
zeljko wrote
postgres transactions ? I don't understand. If U can connect to XXX server usualy at port 5432 then it works, or it returns exception like : Is the server XXXXX running on port 5432 ? etc ...

I see.

So, if I put http://192.168.1.20:5432 into my browser, then I should see a message from postgreSQL? or an error message if it isn't working?

TCP/IP isn't my long suit, I'm afraid.

Reply by email

Joost van der Sluis
to Dave Coventry: Hi. I don't HAVE a windows postgres installation. Do you have copies of the files? The…

Op zondag 25-05-2008 om 17:54 uur [tijdzone +0200], schreef Dave Coventry:

I don't HAVE a windows postgres installation.

Then you can't use postgres on that machine.

Why are they needed, anyway? I don't see any mention of their requirement in the wiki(s).

"I need to read this word-document. And now someone tells me to install 'Microsoft Word'. That's bull, it must be something else. Why do I need Word, anyway?"

I'm not actually convinced that this is the problem; how do I test to see if the Ubuntu server is allowing Postgres transactions?

If the error says: the postgres-client is not installed, you doubt that that is the problem?!?

If you want to test if your ubuntu-server to allow postgres-connections, you can do that with the 'psql' utility. If you want to know where you can find it: it's part of the postgresql-client. You know, that application that you don't need.

Many thanks,

Sorry, coudn't resist.

Reply by email

Damien Gerard
to Dave Coventry: I see. So, if I put http://192.168.1.20:5432 into my browser, then I should see a message…

Le May 25, 2008 ? 9:19 PM, Dave Coventry a ?crit :

Show quoted text 13 lines
On Sun, May 25, 2008 at 6:49 PM, zeljko wrote: > postgres transactions ? I don't understand. > If U can connect to XXX server usualy at port 5432 then it works, > or it > returns exception like : Is the server XXXXX running on port 5432 ? > etc ... I see. So, if I put http://192.168.1.20:5432 into my browser, then I should see a message from postgreSQL? or an error message if it isn't working?

Postgres is not a web server.
See yours logs and pgAdmin to know what postgres is doing

However you can try a telnet to know if postgres is listening # telnet <your server ip address> 5432

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email

Damien Gerard
to Dave Coventry: That would be great. I have googled quite a bit, but only come up with the 7.0 version of…

Le May 25, 2008 ? 9:14 PM, Dave Coventry a ?crit :

Show quoted text 10 lines
On Sun, May 25, 2008 at 7:07 PM, Damien Gerard wrote: > However I have not use yet postgres with lazarus but I can make you > an > archive if needed Hi Damien, That would be great. I have googled quite a bit, but only come up with the 7.0 version of libpq.dll

All these files are part of the windows installer provided by postgres.org
8.2
http://ftn.shikami.org/misc/Lazarus/postgres/8.2/

With those files in the directory of your app you should not have to install postgres

What would be the requirement be if I were to port my app to linux?

Trust your linux distro to provide all your needs and all needed dependancies.
So it Depends of your linux.

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email

Dave Coventry
to Joost van der Sluis: Op zondag 25-05-2008 om 17:54 uur [tijdzone +0200], schreef Dave Coventry: Then you can't…
Joost van der Sluis wrote
Then you can't use postgres on that machine.
"I need to read this word-document. And now someone tells me to install 'Microsoft Word'. That's bull, it must be something else. Why do I need Word, anyway?"

Hmm.

If the error says: the postgres-client is not installed, you doubt that that is the problem?!?

Well, yes, sometimes error messages tend to describe a general error condition rather than a specific cause. Try using the windows troubleshooter if you can't get a printer to work.

If you want to test if your ubuntu-server to allow postgres-connections, you can do that with the 'psql' utility. If you want to know where you can find it: it's part of the postgresql-client. You know, that application that you don't need.

Well, I think a better solution would probably be to use telnet as suggested by another subscriber.

Sorry, coudn't resist.

The point is that I don't want to have to install PostgreSQL on every machine that uses my app.

Fine, if I have to include a few dlls as part of the package, but I saw no mention of this in the wiki.

Reply by email

Dave Coventry
to Damien Gerard: Le May 25, 2008 ? 9:14 PM, Dave Coventry a ?crit : All these files are part of the…

Thanks Damien.

I'm downloading them now.

9 Meg on my dialup.

Damien Gerard wrote 51 lines
Le May 25, 2008 ? 9:14 PM, Dave Coventry a ?crit : > On Sun, May 25, 2008 at 7:07 PM, Damien Gerard > wrote: >> However I have not use yet postgres with lazarus but I can make you >> an >> archive if needed > > Hi Damien, > > That would be great. I have googled quite a bit, but only come up with > the 7.0 version of libpq.dll All these files are part of the windows installer provided by postgres.org 8.2 http://ftn.shikami.org/misc/Lazarus/postgres/8.2/ With those files in the directory of your app you should not have to install postgres > > > What would be the requirement be if I were to port my app to linux? Trust your linux distro to provide all your needs and all needed dependancies. So it Depends of your linux. -- Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Damien Gerard
to Damien Gerard

Le May 25, 2008 ? 11:48 PM, Damien Gerard a ?crit :

Show quoted text 13 lines
Le May 25, 2008 ? 10:34 PM, Dave Coventry a ?crit : > Thanks Damien. > > I'm downloading them now. > > 9 Meg on my dialup. Moved to http://lazarus.shikami.org/downloads/postgres-standalone/8.2/ More appropriated and ftn.shikami.org is not a place for temporary files

Very tired tonight ...
ftn is for temporary files
and it is http://lazarus.shikami.org/downloads/windows/postgres-standalone/8.2/

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat

Reply by email