Re: Automatic detection of PostgreSQL version

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Automatic detection of PostgreSQL version
Дата
Msg-id Pine.LNX.4.44.0303120121460.1617-100000@peter.localdomain
обсуждение исходный текст
Ответ на Automatic detection of PostgreSQL version  (Roberto Costa <rob.costa@libero.it>)
Ответы Re: Automatic detection of PostgreSQL version  (Rodrigo Moya <rodrigo@gnome-db.org>)
Список pgsql-interfaces
Roberto Costa writes:

> What I'm currently doing is searching typical include directories (like
> /usr/include, /usr/local/share/include, ...) for the presence of a
> directory named postgresql or pgsql that contains config.h or
> pg_config.h (used since PostgreSQL 7.2, if I'm not wrong). When such a
> file is found, I grep it for a line that starts with "#define
> PG_VERSION" and I expect the version follow and be in the form "x.y.z".
> This works for the latest PostgreSQL versions that I could test,
> however I don't know whether this check may work with earlier ones. In
> reality I even ignore if this kind of check is the best way to get what
> I want.

All of that seems highly unusual.  configure scripts are supposed to check
for alternative features in libraries, not search the entire file system
for the "best" library.  I suggest you just include the libpq++ header
file in your code and be done with it.  If it's missing the user will get
an error from the compiler and will know what to do.  (Possibly there will
be some documentation to help him, too.)  Users that have multiple
versions installed can select the one to use with the usual CPPFLAGS and
LDFLAGS variables.

-- 
Peter Eisentraut   peter_e@gmx.net



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: permanently setting PROMPT1
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Postgres Scaling