Automatic detection of PostgreSQL version
От | Roberto Costa |
---|---|
Тема | Automatic detection of PostgreSQL version |
Дата | |
Msg-id | 3E6CFF49.54AF36EB@libero.it обсуждение исходный текст |
Ответы |
Re: Automatic detection of PostgreSQL version
Re: Automatic detection of PostgreSQL version |
Список | pgsql-interfaces |
Hello, I'm starting an open-source project, which will include a client to access a PostgreSQL database through libpq++ library. I'm quite new to PostgreSQL and I haven't followed its development, this is why I hope to find some information I need here! For the configure.ac file of the above mentioned project, I would like to use an autoconf macro to detect the location of PostgreSQL's include directory eventually installed on the system and, if more than one are found, to select the most recent (by default). I looked over the internet to see whether such a macro is already available somewhere, I couldn't find it and I began writing my own one. 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. What do you think about that? Do you know where I could find the information I'm looking for? Any suggestion, comment or remark is more than welcome! Cheers, Roberto
В списке pgsql-interfaces по дате отправления: