Home > Archive > PostgreSQL Discussion > August 2005 > Problem finding libpg.3.dylib on macos X in plperlu procedure









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem finding libpg.3.dylib on macos X in plperlu procedure
Sean Davis

2005-08-24, 8:24 pm

I ran across this problem while running a plperlu procedure. I do not have
a libpq.3.dylib, but do have a libpq.4.dylib. I am running perl 5.8.1,
macos 10.3.8 on an Xserve G5, and Postgres 8.0.2. Any suggestions? I
should mention that other db functions seem to work just fine.

From psql:

select
utilities. make_mysql_idmap('xx
xx','xxxx','localhos
t','xxxx','xxxx','xx
xx','i
dmap','idmap','idmap
');
psql: NOTICE: Connecting....
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
psql: connection to server was lost

From my server log:

NOTICE: Connecting....
dyld: /usr/local/pgsql/bin/postmaster can't open library:
/usr/local/pgsql/lib/libpq.3.dylib (No such file or directory, errno = 2)
LOG: server process (PID 826) was terminated by signal 5
LOG: terminating any other active server processes
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted at 2005-08-24 16:24:07 EDT
LOG: checkpoint record is at 18/A35570C0
LOG: redo record is at 18/A35570C0; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 44610957; next OID: 473189363
LOG: database system was not properly shut down; automatic recovery in
progress
LOG: record with zero length at 18/A3557100
LOG: redo is not required
LOG: database system is ready

And the offending procedure:

create or replace function utilities. make_mysql_idmap(pg_
user text,pg_pass
text,pg_host text,mysql_user text,mysql_pass text,mysql_host text,mysql_db
text,idmaptable text,query text) returns boolean as $$
use strict;
use warnings;
use DBI;

my
($pg_user,$pg_pass,$
pg_host,$mysql_user,
$mysql_pass,$mysql_h
ost,$mysql_db,$i
dmaptable,$query) = @_;
elog NOTICE, "Connecting....";
my $dbh_pg =
DBI->connect(" dbi:Pg:dbname=annodb
4;host=$pg_host",$pg_user,$pg_pass) or
elog ERROR, 'cannot connect to postgres';
elog NOTICE, "Connected....";
my $dbh_mysql =
DBI->connect(" dbi:mysql:database=$
mysql_db;host=$mysql
_host",$mysql_user,$my
sql_pass) or elog ERROR, 'cannot connect to mysql';
elog NOTICE, "Connected....";

$dbh_mysql->do("DROP TABLE $idmaptable");
elog NOTICE, "Dopped table $idmaptable";
$dbh_mysql->do(qq/CREATE TABLE $idmaptable (
id_no autoincrement primary key,
from_id varchar(15),
from_value varchar(15),
to_id varchar(200),
to_value varchar(15))/);
elog NOTICE, "Created table $idmaptable";
my $sth_pg = $dbh_pg->prepare(qq/
select ug_id,'Hs.data',symbol,'gene' from ug_main where species='Hs'
union
select ug_id,'Mm.data',symbol,'gene' from ug_main where species='Mm'
union
select ug_id,'Mm. data',description,'t
itle' from ug_main where species='Mm'
union
select ug_id,'Hs. data',description,'t
itle' from ug_main where species='Hs'/
);
$sth_pg->execute();
my $sth_mysql = $dbh_mysql->prepare(qq/INSERT into $idmaptable
(from_id,from_value,
to_id,to_value) values (?,?,?,?)/);
while (my $row = $sth_pg->selectrow_arrayref) {
$sth_mysql->execute(@{$row});
}
$sth_mysql->finish;
$sth_pg->finish;
$dbh_mysql->disconnect;
$dbh_pg->disconnect;
return 1;
$$ language plperlu;


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Tom Lane

2005-08-24, 8:24 pm

Sean Davis <sdavis2@mail.nih.gov> writes:
> I ran across this problem while running a plperlu procedure. I do not have
> a libpq.3.dylib, but do have a libpq.4.dylib. I am running perl 5.8.1,
> macos 10.3.8 on an Xserve G5, and Postgres 8.0.2. Any suggestions?


> dyld: /usr/local/pgsql/bin/postmaster can't open library:
> /usr/local/pgsql/lib/libpq.3.dylib (No such file or directory, errno = 2)


It appears that your DBI::Pg module was built against an older
copy of libpq. Best solution would be to recompile DBI::Pg.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com