Re: [GENERAL] querying the version of libpq

2010-10-14 Thread Dmitriy Igrishin
2010/10/14 Massa, Harald Armin > Dmitriy, > >> >> Again, I suggest PQlibVersion() or PQversion() instead of >> PQlibpqVersion(). >> >> Why this "pq" redundancy in name? Waste of bytes. >> >> the first PQ qualifies the name-space "those are PostgresQl functions". > the library is called libpq, and

Re: [GENERAL] querying the version of libpq

2010-10-14 Thread Massa, Harald Armin
Dmitriy, > > Again, I suggest PQlibVersion() or PQversion() instead of PQlibpqVersion(). > > Why this "pq" redundancy in name? Waste of bytes. > > the first PQ qualifies the name-space "those are PostgresQl functions". the library is called libpq, and we are explicitly asking for the version of li

Re: [GENERAL] querying the version of libpq

2010-10-14 Thread Dmitriy Igrishin
Hey Massa, Again, I suggest PQlibVersion() or PQversion() instead of PQlibpqVersion(). Why this "pq" redundancy in name? Waste of bytes. 2010/10/14 Massa, Harald Armin > And the dynamic linker will take any version of libpq.so that has the same >> major number, meaning that you >> cannot assu

Re: [GENERAL] querying the version of libpq

2010-10-14 Thread Massa, Harald Armin
> > And the dynamic linker will take any version of libpq.so that has the same > major number, meaning that you > cannot assume that it's not 8.4 just because you built against 9.0. > > [...] > Not to mention when you're on windows (and I dunno if any other > platforms are like *that*), where the

Re: [GENERAL] querying the version of libpq

2010-10-06 Thread Magnus Hagander
On Wed, Oct 6, 2010 at 15:54, Tom Lane wrote: > Magnus Hagander writes: >> On Wed, Oct 6, 2010 at 14:17, Greg Sabino Mullane wrote: But that's build-time, not run-time. >>> >>> Correct, not sure of your point. Is this a problem? Build-time is >>> what we want here (determining the libpq we

Re: [GENERAL] querying the version of libpq

2010-10-06 Thread Tom Lane
Magnus Hagander writes: > On Wed, Oct 6, 2010 at 14:17, Greg Sabino Mullane wrote: >>> But that's build-time, not run-time. >> >> Correct, not sure of your point. Is this a problem? Build-time is >> what we want here (determining the libpq we were built with) > The original question was how to

Re: [GENERAL] querying the version of libpq

2010-10-06 Thread Magnus Hagander
On Wed, Oct 6, 2010 at 14:17, Greg Sabino Mullane wrote: > > >> Not sure what you mean. pg_config *drives* the compilation and linking, >> we don't blindly compile and simply take pg_config's word for it. >> pg_config --libdir and pg_config --includedir. > >> But that's build-time, not run-time. >

Re: [GENERAL] querying the version of libpq

2010-10-06 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Not sure what you mean. pg_config *drives* the compilation and linking, > we don't blindly compile and simply take pg_config's word for it. > pg_config --libdir and pg_config --includedir. > But that's build-time, not run-time. Correct, not

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Magnus Hagander
On Tue, Oct 5, 2010 at 22:53, Greg Sabino Mullane wrote: > >>> Er...yes it will match exact...because we[1] get the location of the >>> library files from pg_config as well. :) Handy little utility that. >> >> How do you get pg_config to tell you which of the multiple versions of >> libpq that may

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Tom Lane
"Greg Sabino Mullane" writes: >> The real problem is that neither of these can be trusted to tell you the >> *library* version. PQserverVersion() is something else altogether, >> and I wouldn't want to assume that pg_config exactly matches the library >> you're linked to --- if it's even present

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 >> Er...yes it will match exact...because we[1] get the location of the >> library files from pg_config as well. :) Handy little utility that. > > How do you get pg_config to tell you which of the multiple versions of > libpq that may be install

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Magnus Hagander
On Tue, Oct 5, 2010 at 22:39, Greg Sabino Mullane wrote: > > >> The real problem is that neither of these can be trusted to tell you the >> *library* version.  PQserverVersion() is something else altogether, >> and I wouldn't want to assume that pg_config exactly matches the library >> you're link

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Dmitriy Igrishin
Hey all, Could you call it as PQlibVersion() or even PQversion() instead of PQlibpqVersion() ? 2010/10/5 Tom Lane > Peter Geoghegan writes: > > On 5 October 2010 16:33, Greg Sabino Mullane wrote: > >>> How does the driver figure it out? > >> > >> DBD::Pg parses pg_config --version, then passe

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > The real problem is that neither of these can be trusted to tell you the > *library* version. PQserverVersion() is something else altogether, > and I wouldn't want to assume that pg_config exactly matches the library > you're linked to --- if

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Massa, Harald Armin
> > > > We could add a PQlibpqVersion(), maybe, but it would be many years > > before client code could rely on that being present. > > I think we should. > > And in a small way they can already - if they check for it > dynamically, they'll know if it was 9.1 or newer at least :-) It'll be > a long

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Magnus Hagander
On Tue, Oct 5, 2010 at 18:41, Tom Lane wrote: > Peter Geoghegan writes: >> On 5 October 2010 16:33, Greg Sabino Mullane wrote: How does the driver figure it out? >>> >>> DBD::Pg parses pg_config --version, then passes the information >>> to the C programs for directive fiddling. I certainly

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Tom Lane
Peter Geoghegan writes: > On 5 October 2010 16:33, Greg Sabino Mullane wrote: >>> How does the driver figure it out? >> >> DBD::Pg parses pg_config --version, then passes the information >> to the C programs for directive fiddling. I certainly hope >> other drivers are doing the same, as libpq v

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Massa, Harald Armin
> > I would imagine that most libpq wrapping drivers use libpq's > PQserverVersion(), which returns an integer that looks like 9. > > exactly that is exposed as cn.server_version property of the psycopg2 connection object; but it does not help, as a 8.4libpq happily connects to a 9.0 server...

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I would imagine that most libpq wrapping drivers use libpq's > PQserverVersion(), which returns an integer that looks like 9. Yeah, I'm familiar with that (I wrote it :) but it's not useful here for two reasons: 1) It's not available on

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Peter Geoghegan
On 5 October 2010 16:33, Greg Sabino Mullane wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > >>> if ($dbh->{pg_lib_version} >= 9) { >>> >>> I'd raise a bug with psycopg2 if it does not provide that information. >> >> How does the driver figure it out? > > DBD::Pg parses pg_

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 >> if ($dbh->{pg_lib_version} >= 9) { >> >> I'd raise a bug with psycopg2 if it does not provide that information. > > How does the driver figure it out? DBD::Pg parses pg_config --version, then passes the information to the C programs for