Re: plpgsql.dll path

Lists: pgsql-cygwin
From: "Felipe Nievinski" <fnievinski2(at)terra(dot)com(dot)br>
To: "pgsql-cygwin" <pgsql-cygwin(at)postgresql(dot)org>
Subject: plpgsql.dll path
Date: 2002-05-09 15:20:11
Message-ID: GVUNXN$011AD5F179F69D116968C30C80E5BC60@terra.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Hi.
I'm using PostgreSQL v7.2.1-1 on top of MS-Windows98.

When I type
pg_restore -d geosist geosist-maio09.dmp
I get the following error msg:
pg_restore: [archiver (db)] could not execute query: ERROR:
stat failed on file '/usr/lib/plpgsql.dll': No such file or
directory

plpgsql.dll is at /usr/lib/postgresql/ (instead of /usr/lib/, where it
is expected to be by pg_restore).

Creating a link
ln -s /usr/lib/postgresql/plpgsql.dll /usr/lib/plpgsql.dll
makes pg_restore to work fine.

I'm not sure where this file should actually reside. I'll keep it at
both directories while not sure.
Is there any additional info on this?

Thanks for the work on the cygwin port.

Regards,
Felipe N.


From: Jason Tishler <jason(at)tishler(dot)net>
To: Felipe Nievinski <fnievinski2(at)terra(dot)com(dot)br>
Cc: pgsql-cygwin <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: plpgsql.dll path
Date: 2002-05-12 14:27:01
Message-ID: 20020512142701.GC3144@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Felipe,

On Thu, May 09, 2002 at 01:20:11PM -0200, Felipe Nievinski wrote:
> I'm using PostgreSQL v7.2.1-1 on top of MS-Windows98.
>
> When I type
> pg_restore -d geosist geosist-maio09.dmp
> I get the following error msg:
> pg_restore: [archiver (db)] could not execute query: ERROR:
> stat failed on file '/usr/lib/plpgsql.dll': No such file or
> directory
>
> [snip]
>
> Is there any additional info on this?

Note that I have never used pg_dump/pg_restore before, so I can be
*completely* off-base with the following. I also think that the above
may not be specifically a Cygwin PostgreSQL problem.

Are you upgrading from 7.1.x (or earlier) to 7.2.x? I ask this for the
following reasons:

$ tar -tjf postgresql-7.1.3-2.tar.bz2 | fgrep plpgsql.dll
usr/lib/plpgsql.dll

$ tar -tjf postgresql-7.2.1-1.tar.bz2 | fgrep plpgsql.dll
usr/lib/postgresql/plpgsql.dll

$ strings /usr/bin/pg_restore.exe | fgrep plpgsql.dll

Hence, the path to plpgsql.dll is *not* burned into pg_restore.exe. Is
it in geosist-maio09.dmp? Or, is this kind of info stored in some other
PostgreSQL file?

Can someone knowledgeable is this area please confirm or refute the
above?

> Thanks for the work on the cygwin port.

You are welcome.

Thanks,
Jason


From: Barry Pederson <bp(at)barryp(dot)org>
To: Jason Tishler <jason(at)tishler(dot)net>
Cc: Felipe Nievinski <fnievinski2(at)terra(dot)com(dot)br>, pgsql-cygwin <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: plpgsql.dll path
Date: 2002-05-12 14:46:09
Message-ID: 3CDE8031.9080703@barryp.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Jason Tishler wrote:
>
> Hence, the path to plpgsql.dll is *not* burned into pg_restore.exe. Is
> it in geosist-maio09.dmp? Or, is this kind of info stored in some other
> PostgreSQL file?
>
> Can someone knowledgeable is this area please confirm or refute the
> above?

The path to a dll for a procedural language is stored in the database. If you
pg_dump the schema, you'll see it in there, like:

-------------------------------------
--
-- TOC Entry ID 9 (OID 22011682)
--
-- Name: "plpgsql_call_handler" () Type: FUNCTION Owner: barryp
--

CREATE FUNCTION "plpgsql_call_handler" () RETURNS opaque AS
'/usr/lib/plpgsql.dll', 'plpgsql_call_handler' LANGUAGE 'C';

--
-- TOC Entry ID 10 (OID 22011683)
--
-- Name: plpgsql Type: PROCEDURAL LANGUAGE Owner:
--

CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER "plpgsql_call_handler"
LANCOMPILER 'PL/pgSQL';
--------------------------------------

The path to the libraries does seem to have changed between 7.1 and 7.2 - and
it's not a cygwin thing, the same deal happened to me on a FreeBSD box.

There are at least two ways you can work around this (I've done both)

1) setup a symlink from the old path to the new path:

ln -s /usr/lib/postgresql/plpgsql.dll /usr/lib/plpgsql.dll

2) dump the schema, fix the path, create a new db, load the fixed schema, and
the restore just the data.

The first solution is easiest, by you have to be sure to keep that symlink
there. The second is harder, but fixes it permanently (or at least until the
next time they change the path).

Barry


From: Jason Tishler <jason(at)tishler(dot)net>
To: Barry Pederson <bp(at)barryp(dot)org>
Cc: Felipe Nievinski <fnievinski2(at)terra(dot)com(dot)br>, pgsql-cygwin <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: plpgsql.dll path
Date: 2002-05-12 20:14:02
Message-ID: 20020512201402.GA1908@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Barry,

On Sun, May 12, 2002 at 09:46:09AM -0500, Barry Pederson wrote:
> Jason Tishler wrote:
> >Can someone knowledgeable is this area please confirm or refute the
> >above?
>
> The path to a dll for a procedural language is stored in the database. If
> you pg_dump the schema, you'll see it in there, like:
>
> [snip]
>
> The path to the libraries does seem to have changed between 7.1 and 7.2 -
> and it's not a cygwin thing, the same deal happened to me on a FreeBSD box.

Thanks for the above info. I didn't think this was a Cygwin problem, but
wanted to be sure.

Jason