Re: PATCH: Report libpq version and configuration

2020-12-28 Thread Masahiko Sawada
Hi Craig, On Wed, Nov 11, 2020 at 1:11 PM Craig Ringer wrote: > > On Tue, Nov 10, 2020 at 2:22 PM Craig Ringer > wrote: >> >> >> The main things I'd really like to get in place are a way to get the version >> as an ELF data symbol, and a simple way to ID the binary. >> >> So the minimal change

Re: PATCH: Report libpq version and configuration

2020-11-10 Thread Craig Ringer
On Tue, Nov 10, 2020 at 2:22 PM Craig Ringer wrote: > > The main things I'd really like to get in place are a way to get the > version as an ELF data symbol, and a simple way to ID the binary. > > So the minimal change would be to declare: > > const char LIBPQ_VERSION_STR[] = PG_VERSION_STR; > co

Re: PATCH: Report libpq version and configuration

2020-11-09 Thread Craig Ringer
On Tue, Nov 10, 2020 at 12:33 AM Tom Lane wrote: > Alvaro Herrera writes: > > Well, if we can make it run in more systems than just Linux, then it > > seems worth having. The submitted patch seems a little bit on the > > naughty side. > > I agree that the facility seems possibly useful, as long

Re: PATCH: Report libpq version and configuration

2020-11-09 Thread Tom Lane
Alvaro Herrera writes: > Well, if we can make it run in more systems than just Linux, then it > seems worth having. The submitted patch seems a little bit on the > naughty side. I agree that the facility seems possibly useful, as long as we can minimize its platform dependency. Just embedding s

Re: PATCH: Report libpq version and configuration

2020-11-09 Thread Alvaro Herrera
On 2020-Oct-27, Craig Ringer wrote: > On Tue, Oct 27, 2020 at 12:56 AM Tom Lane wrote: > > > +1. Are we concerned about translatability of these strings? I think > > I'd vote against, as it would complicate applications, but it's worth > > thinking about it now not later. > > It's necessary no

Re: PATCH: Report libpq version and configuration

2020-10-26 Thread Craig Ringer
On Tue, Oct 27, 2020 at 12:56 AM Tom Lane wrote: > > Alvaro Herrera writes: > > On 2020-Oct-26, Craig Ringer wrote: > >> also adds PQlibInfoPrint() which dumps PQlibInfo() keys/values to stdout. > > > Sounds useful. I'd have PQlibInfoPrint(FILE *) instead, so you can pass > > stdout or whichever

Re: PATCH: Report libpq version and configuration

2020-10-26 Thread Craig Ringer
On Tue, Oct 27, 2020 at 12:41 AM Alvaro Herrera wrote: > On 2020-Oct-26, Craig Ringer wrote: > > > Patch 0001 adds PQlibInfo(), which returns an array of key/value > > description items reporting on configuration like the full version > string, > > SSL support, gssapi support, thread safety, defa

Re: PATCH: Report libpq version and configuration

2020-10-26 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Oct-26, Craig Ringer wrote: >> also adds PQlibInfoPrint() which dumps PQlibInfo() keys/values to stdout. > Sounds useful. I'd have PQlibInfoPrint(FILE *) instead, so you can pass > stdout or whichever fd you want. +1. Are we concerned about translatability of th

Re: PATCH: Report libpq version and configuration

2020-10-26 Thread Abhijit Menon-Sen
At 2020-10-26 20:56:57 +0800, craig.rin...@enterprisedb.com wrote: > > $ ./build/src/interfaces/libpq/libpq.so > VERSION_NUM: 14 > VERSION: PostgreSQL 14devel on x86_64-pc-linux-gnu, compiled by gcc (GCC) > 10.2.1 20200723 (Red Hat 10.2.1-1), 64-bit > CONFIGURE_ARGS: '--cache-file=config.cach

Re: PATCH: Report libpq version and configuration

2020-10-26 Thread Alvaro Herrera
On 2020-Oct-26, Craig Ringer wrote: > Patch 0001 adds PQlibInfo(), which returns an array of key/value > description items reporting on configuration like the full version string, > SSL support, gssapi support, thread safety, default port and default unix > socket path. This is for application use

PATCH: Report libpq version and configuration

2020-10-26 Thread Craig Ringer
The attached patches propose new interfaces for exposing more configuration and versioning information from libpq at runtime. They are to be used by applications to obtain finer grained information about libpq's configuration (SSL, GSSAPI, etc), to identify libpq binaries, and for applications that