Обсуждение: FPK Pascal and Postgres

Поиск
Список
Период
Сортировка

FPK Pascal and Postgres

От
Robert Hiltibidal
Дата:
Morning,

I have been experimenting with the FPK Pascal for linux found at
http://tfdec1.fys.kuleuven.ac.be/~michael/fpc/ and postgres 6.5.1

I noticed the latest version of FPK includes a postgres unit. Coolnesssss....

I downloaded the postgres tar file from the FPK site and am trying to
understand how the pascal interface works. 

I created a db called robpas. I ran the mkdb program included in the
tarfile adn it created a table with various email addresses.

So... I know this much is working.

When I run either the testemail or the testpg examples I get the following
errors:


/y2k/pascal/postgres -- 10:17am
y2k{rob}192 ->testpg
testpg: error in loading shared libraries
libpq.so.2.0: cannot open shared object file: No such file or directory

/y2k/pascal/postgres -- 10:17am
y2k{rob}193 ->testemail
testemail: error in loading shared libraries
libpq.so.2.0: cannot open shared object file: No such file or directory


libpq.so.2.0 exists in /y2k/pgsql/lib. I have a symbolic link in
/usr/local/pgsql that points to /y2k/pgsql. In short they both point to the
same place. Both /y2l/pgsql/lib and /usr/local/pgsql/lib are listed
specifically in my path environment.

Any help would be greatly appreciated.

Thanks,

-Rob





Re: [INTERFACES] FPK Pascal and Postgres

От
"Ken J. Wright"
Дата:
Hi Rob,

>/y2k/pascal/postgres -- 10:17am
>y2k{rob}192 ->testpg
>testpg: error in loading shared libraries
>libpq.so.2.0: cannot open shared object file: No such file or directory

Make sure you have an entry in /etc/ld.so.conf,

/usr/local/pgsql/lib

then run /sbin/ldconfig to register the postgres library with the so loader
cache.
ldconfig -p will show what's currently in the cache.

Also, in your /etc/ppc386.cfg you may need to have an entry also,

# Search path for libraries
-Fl/usr/local/pgsql/lib

Ken


Re: [INTERFACES] FPK Pascal and Postgres

От
The Hermit Hacker
Дата:
On Wed, 1 Sep 1999, Robert Hiltibidal wrote:

> Morning,
> 
> I have been experimenting with the FPK Pascal for linux found at
> http://tfdec1.fys.kuleuven.ac.be/~michael/fpc/ and postgres 6.5.1
> 
> I noticed the latest version of FPK includes a postgres unit. Coolnesssss....
> 
> I downloaded the postgres tar file from the FPK site and am trying to
> understand how the pascal interface works. 
> 
> I created a db called robpas. I ran the mkdb program included in the
> tarfile adn it created a table with various email addresses.
> 
> So... I know this much is working.
> 
> When I run either the testemail or the testpg examples I get the following
> errors:
> 
> 
> /y2k/pascal/postgres -- 10:17am
> y2k{rob}192 ->testpg
> testpg: error in loading shared libraries
> libpq.so.2.0: cannot open shared object file: No such file or directory
> 
> /y2k/pascal/postgres -- 10:17am
> y2k{rob}193 ->testemail
> testemail: error in loading shared libraries
> libpq.so.2.0: cannot open shared object file: No such file or directory
> 
> 
> libpq.so.2.0 exists in /y2k/pgsql/lib. I have a symbolic link in
> /usr/local/pgsql that points to /y2k/pgsql. In short they both point to the
> same place. Both /y2l/pgsql/lib and /usr/local/pgsql/lib are listed
> specifically in my path environment.

Did you 'ldconfig' so that the linker knows where to find the library?

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: [INTERFACES] FPK Pascal and Postgres

От
Robert Hiltibidal
Дата:
My thanks to you and Ken who offered the following ideas:

>Did you 'ldconfig' so that the linker knows where to find the library?

also, in your /etc/ppc386.cfg you may need to have an entry also,

# Search path for libraries
-Fl/usr/local/pgsql/lib

When I did those alteration and rebuilt the postgres.ppu it didn't work. 

I then made the following change in the postgres.pp file

{ $include "/usr/include/libpq/pqcomm.h"}

Well that didn't work either. You guys will laugh at this...

I added a make install, just on a whim. I wasn't sure if I'd be replacing a
more modern unit as the site says its for postgres 6.3.1 and we're running
6.5.1. The rule of thumb round here being make sure it works before you
replace....

It worked. 

Now I can tackle the tackle the fun of relearning....

Thanks again,

-Rob



Re: [INTERFACES] FPK Pascal and Postgres

От
"Ken J. Wright"
Дата:
>I added a make install, just on a whim. I wasn't sure if I'd be replacing a
>more modern unit as the site says its for postgres 6.3.1 and we're running
>6.5.1.

The unit is good for 6.5.x as well. Also if you do Delphi, this unit has
been modified slightly to wrap around libpq.dll for win32. You can find it
at http://www.clubdelphi.com/nico

Cheers!

Ken



Re: [INTERFACES] FPK Pascal and Postgres

От
Robert Hiltibidal
Дата:
Morning,

I installed FPK Pascal on another host last night. I ran into a similar
problem where the error message was:

testpg: error in loading shared libraries
libpq.so.2.0: cannot open shared object file: No such file or directory

I checked both the /etc/ld.so.conf files and the /etc/ppc386.cfg file. I
had the proper enteries in both files. 

The problem was in the postgress.pp file. The include statement was
originally:
{ $include "libpq/pqcomm.h"}

By changing it to the absolute path as listed below everything works great.
Its a bit early for benchmarks but I'm guestimating I'm seeing somewhere's
around 40% speed improvement over Perl. Perhaps today I'll make a benchmark
program and compare the results.

Although I will say it takes about 20 lines of code in perl and about 70
lines in pascal... tradeoff's...gotta love 'em.

{ $include "/usr/include/libpq/pqcomm.h"}


-Rob