Re: dynamic_library_path on Win32

Lists: pgsql-hackerspgsql-patches
From: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: dynamic_library_path on Win32
Date: 2004-05-29 09:41:29
Message-ID: c99lpo$207v$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

I'm using CVS HEAD in a windows environment. I'm trying to start the
postmaster using "postmaster -c dynamic_library_path=C:/foo/bar". It starts
just fine, then, when I ask it to load a module, an error is generating
stating:

ERROR: component in parameter "dynamic_library_path" is not an absolute path

I added a trace to find out what it thinks the path is. It prints "C".
Obviously it treats ':' as a path separator somewhere. Is that the intended
behavior on win32?

Kind regards,

Thomas Hallgren


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-29 13:24:53
Message-ID: 40B88F25.5040604@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Thomas Hallgren wrote:

>I'm using CVS HEAD in a windows environment. I'm trying to start the
>postmaster using "postmaster -c dynamic_library_path=C:/foo/bar". It starts
>just fine, then, when I ask it to load a module, an error is generating
>stating:
>
>ERROR: component in parameter "dynamic_library_path" is not an absolute path
>
>I added a trace to find out what it thinks the path is. It prints "C".
>Obviously it treats ':' as a path separator somewhere. Is that the intended
>behavior on win32?
>
>
>

You've found a bug. Clearly we need to adjust the parsing of
dynamic_library_path and probably preload_libraries for Win32.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-29 15:20:56
Message-ID: 20223.1085844056@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Thomas Hallgren" <thhal(at)mailblocks(dot)com> writes:
> I'm using CVS HEAD in a windows environment. I'm trying to start the
> postmaster using "postmaster -c dynamic_library_path=C:/foo/bar". It starts
> just fine, then, when I ask it to load a module, an error is generating
> stating:

> ERROR: component in parameter "dynamic_library_path" is not an absolute path

> I added a trace to find out what it thinks the path is. It prints "C".
> Obviously it treats ':' as a path separator somewhere.

Yeah. dynamic_library_path follows the universal Unix convention that
search path components are separated by ':'. Is there any equivalent
convention in Windows?

regards, tom lane


From: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-29 15:38:16
Message-ID: thhal-0m0aUAQuqZhIajpxXxC4f6F1bHUHDhV@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Yes, on windows, you use a semicolon as path separator.

regards,

- thomas

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Sent: Saturday, May 29, 2004 17:20
Subject: Re: [HACKERS] dynamic_library_path on Win32

> "Thomas Hallgren" <thhal(at)mailblocks(dot)com> writes:
> > I'm using CVS HEAD in a windows environment. I'm trying to start the
> > postmaster using "postmaster -c dynamic_library_path=C:/foo/bar". It
starts
> > just fine, then, when I ask it to load a module, an error is generating
> > stating:
>
> > ERROR: component in parameter "dynamic_library_path" is not an absolute
path
>
> > I added a trace to find out what it thinks the path is. It prints "C".
> > Obviously it treats ':' as a path separator somewhere.
>
> Yeah. dynamic_library_path follows the universal Unix convention that
> search path components are separated by ':'. Is there any equivalent
> convention in Windows?
>
> regards, tom lane
>


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-29 19:37:51
Message-ID: 40B8E68F.8060206@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:

>"Thomas Hallgren" <thhal(at)mailblocks(dot)com> writes:
>
>
>>I'm using CVS HEAD in a windows environment. I'm trying to start the
>>postmaster using "postmaster -c dynamic_library_path=C:/foo/bar". It starts
>>just fine, then, when I ask it to load a module, an error is generating
>>stating:
>>
>>
>
>
>
>>ERROR: component in parameter "dynamic_library_path" is not an absolute path
>>
>>
>
>
>
>>I added a trace to find out what it thinks the path is. It prints "C".
>>Obviously it treats ':' as a path separator somewhere.
>>
>>
>
>Yeah. dynamic_library_path follows the universal Unix convention that
>search path components are separated by ':'. Is there any equivalent
>convention in Windows?
>
>
>

src/port/exec.c has this:

#ifdef WIN32
#define PATHSEP ';'
#else
#define PATHSEP ':'
#endif

It should probably move to c.h.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-29 23:11:06
Message-ID: 10359.1085872266@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> You've found a bug. Clearly we need to adjust the parsing of
> dynamic_library_path and probably preload_libraries for Win32.

Yup. Using PATHSEP sounded reasonable to me. Any volunteer to fix
this? (Don't forget to patch the docs for these variables, too.)

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: dynamic_library_path on Win32
Date: 2004-05-30 03:07:54
Message-ID: 200405300307.i4U37sE17714@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


I can do it but will be a few days until I get to it.

---------------------------------------------------------------------------

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > You've found a bug. Clearly we need to adjust the parsing of
> > dynamic_library_path and probably preload_libraries for Win32.
>
> Yup. Using PATHSEP sounded reasonable to me. Any volunteer to fix
> this? (Don't forget to patch the docs for these variables, too.)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] dynamic_library_path on Win32
Date: 2004-06-07 22:08:30
Message-ID: ca2ou6$2ho0$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Attached is a patch that takes care of the PATHSEP issue. I made a more
extensive change then what was suggested. I found the file path.c that
contained a lot of "Unix/Windows" agnostic functions so I added a function
there instead and removed the PATHSEP declaration in exec.c altogether. All
to keep things from scattering all over the code.

I also took the liberty of changing the name of the functions
"first_path_sep" and "last_path_sep". Where I come from (and I'm apparently
not alone given the former macro name PATHSEP), they should be called
"first_dir_sep" and "last_dir_sep". The new function I introduced, that
actually finds path separators, is now the "first_path_sep". The patch
contains changes on all affected places of course.

I also changed the documentation on dynamic_library_path to reflect the
chagnes.

Kind regards,

Thomas Hallgren

"Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote in message
news:200405300307(dot)i4U37sE17714(at)candle(dot)pha(dot)pa(dot)us(dot)(dot)(dot)
>
> I can do it but will be a few days until I get to it.
>
> --------------------------------------------------------------------------
-
>
> Tom Lane wrote:
> > Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > > You've found a bug. Clearly we need to adjust the parsing of
> > > dynamic_library_path and probably preload_libraries for Win32.
> >
> > Yup. Using PATHSEP sounded reasonable to me. Any volunteer to fix
> > this? (Don't forget to patch the docs for these variables, too.)
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

Attachment Content-Type Size
patch.txt text/plain 10.9 KB