Обсуждение: Re: [NOVICE] pg_config --pgxs

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

Re: [NOVICE] pg_config --pgxs

От
Tom Lane
Дата:
George Weaver <gweaver@shaw.ca> writes:
> pg_config --version now shows:

> $ pg_config --version
> PostgreSQL 8.1.0

> However, when I try pg_config --pgxs it returns nothing:

> $ pg_config --pgxs

> $

If you're on Windows this probably means that GetShortPathName() is
failing.  I'm not sure what conditions cause that, exactly.  It might be
a good idea if we fixed pg_config to print out the error code rather
than just silently failing.

            regards, tom lane

Re: [NOVICE] pg_config --pgxs

От
George Weaver
Дата:
On March 2 Tom Lane wrote:

> If you're on Windows this probably means that GetShortPathName() is
> failing.  I'm not sure what conditions cause that, exactly.  It might be
> a good idea if we fixed pg_config to print out the error code rather
> than just silently failing.

Hi Tom,

I am using Windows (XP).

Regards,
George


Re: [NOVICE] pg_config --pgxs

От
Thomas Hallgren
Дата:
George Weaver wrote:
> 
> On March 2 Tom Lane wrote:
> 
>> If you're on Windows this probably means that GetShortPathName() is
>> failing.  I'm not sure what conditions cause that, exactly.  It might be
>> a good idea if we fixed pg_config to print out the error code rather
>> than just silently failing.
> 
> Hi Tom,
> 
> I am using Windows (XP).
> 
GetShortPathName() seems to work well on my XP machine:

C:\>pg_config --version
PostgreSQL 8.1.1

C:\>pg_config --pgxs
C:/PROGRA~1/POSTGR~1/8.1/lib/pgxs/src/MAKEFI~1/pgxs.mk

Regards,
Thomas Hallgren



Re: [NOVICE] pg_config --pgxs

От
George Weaver
Дата:
----- Original Message -----
From: "Tom Lane"

> If you're on Windows this probably means that GetShortPathName() is
> failing.  I'm not sure what conditions cause that, exactly.  It might be
> a good idea if we fixed pg_config to print out the error code rather
> than just silently failing.

I think I have figured out what the problem is.

I installed the binary version of 8.1 via the msi-installer which creates
the PostgreSQL bin directory as "C:\Program Files\PostgreSQL\8.1\bin".

I then downloaded and installed the source code in order to compile and
install the xml2 contrib module.  When I extracted
"postgresql-8.1.0.tar.bz2" to the "C:\Program Files\PostgreSQL" directory,
it creates the directory "C:\Program Files\PostgreSQL\postgresql-8.1.0".  I
did not need to make and install the entire package from source in order to
build and install the xml2 module, so the directories remain as above.

When pg_config is run, it's assuming that bindir is "C:/Program
Files/PostgreSQL/8.1/bin" and starts all its path searches basis this
directory.

For pgxs, it concatentates the libdir with "/pgxs/src/makefiles/pgxs.mk" so
its looking for "C:/Program
Files/PostgreSQL/8.1/lib/pgxs/src/makefiles/pgxs.mk" which doesn't exist.
In fact under the source tree for 8.1.0 there is no directory "pgxs".  If I
create a directory "/pgxs/src/makefiles" under "C:/Program
Files/PostgreSQL/8.1/lib/" and copy pgxs.mk to this directory, pg_config
finds it correctly:

C:\>pg_config --pgxs
C:/PROGRA~1/POSTGR~1/8.1/lib/pgxs/src/MAKEFI~1/pgxs.mk

If I made the entire package from source and installed it, would it have
created the directory "/pgxs/src/makefiles" under "C:/Program
Files/PostgreSQL/8.1/lib/"?

Regards,
George








Re: [NOVICE] pg_config --pgxs

От
Tom Lane
Дата:
George Weaver <gweaver@shaw.ca> writes:
> For pgxs, it concatentates the libdir with "/pgxs/src/makefiles/pgxs.mk" so
> its looking for "C:/Program
> Files/PostgreSQL/8.1/lib/pgxs/src/makefiles/pgxs.mk" which doesn't exist.
> ...
> If I made the entire package from source and installed it, would it have
> created the directory "/pgxs/src/makefiles" under "C:/Program
> Files/PostgreSQL/8.1/lib/"?

Yes, it should have.  I think the issue here is that GetShortPathName
insists on the target path actually existing, whereas the Unix
environment imposes no such requirement.

Not sure if we should try to do anything about this --- if the file is
not there, it isn't going to help a lot for pg_config to print out where
it should have been, so really there's not much functionality loss
involved here.

            regards, tom lane

Re: pg_config --pgxs

От
Thomas Hallgren
Дата:
Tom Lane wrote:
> Not sure if we should try to do anything about this --- if the file is
> not there, it isn't going to help a lot for pg_config to print out where
> it should have been, so really there's not much functionality loss
> involved here.
> 
A check if the GetShortPathName produces an empty filename (or whatever it is that's causing 
that output) resulting in a 'file not found' or something that makes more sense than mere 
silence seems appropriate. It would prevent this topic from popping up again.

Regards,
Thomas Hallgren