Re: PATCH: Report libpq version and configuration

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: PATCH: Report libpq version and configuration
Дата
Msg-id 20201026164146.GA27049@alvherre.pgsql
обсуждение исходный текст
Ответ на PATCH: Report libpq version and configuration  (Craig Ringer <craig.ringer@enterprisedb.com>)
Ответы Re: PATCH: Report libpq version and configuration  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PATCH: Report libpq version and configuration  (Craig Ringer <craig.ringer@enterprisedb.com>)
Список pgsql-hackers
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 and application diagnostics. It
> also adds PQlibInfoPrint() which dumps PQlibInfo() keys/values to stdout.
> See the commit message in patch 0001 for details.

Sounds useful. I'd have PQlibInfoPrint(FILE *) instead, so you can pass
stdout or whichever fd you want.

> Patch 0002 exposes LIBPQ_VERSION_STR, LIBPQ_VERSION_NUM and
> LIBPQ_CONFIGURE_ARGS symbols in the dynamic symbol table. These can be
> accessed by a debugger even when the library cannot be loaded or executed,
> and unlike macros are available even in a stripped executable. So they can
> be used to identify a libpq binary found in the wild. Their storage is
> shared with PQlibInfo()'s static data, so they only cost three symbol table
> entries.

Interesting.  Is this real-world useful?  I'm thinking most of the time
I'd just run the library, but maybe you know of cases where that doesn't
work?

> Patch 0003 allows libpq.so to be executed directly from the command line to
> print its version, configure arguments etc exactly as PQlibInfoPrint()
> would output them. This is only enabled on x64 linux for now but can be
> extended to other targets quite simply.

+1 --- to me this is the bit that would be most useful, I expect.



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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: new heapcheck contrib module
Следующее
От: Abhijit Menon-Sen
Дата:
Сообщение: Re: PATCH: Report libpq version and configuration