Thread: pgsql: Add new system view, pg_config

pgsql: Add new system view, pg_config

From
Joe Conway
Date:
Add new system view, pg_config

Move and refactor the underlying code for the pg_config client
application to src/common in support of sharing it with a new
system information SRF called pg_config() which makes the same
information available via SQL. Additionally wrap the SRF with a
new system view, as called pg_config.

Patch by me with extensive input and review by Michael Paquier
and additional review by Alvaro Herrera.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a5c43b886942e96ec5c745041f2d6a50c3205147

Modified Files
--------------
doc/src/sgml/catalogs.sgml           |  52 +++++
src/backend/catalog/system_views.sql |   6 +
src/backend/utils/misc/Makefile      |   4 +-
src/backend/utils/misc/pg_config.c   | 103 +++++++++
src/bin/pg_config/Makefile           |  14 --
src/bin/pg_config/pg_config.c        | 429 ++++-------------------------------
src/common/Makefile                  |  19 +-
src/common/config_info.c             | 206 +++++++++++++++++
src/include/catalog/catversion.h     |   2 +-
src/include/catalog/pg_proc.h        |   4 +
src/include/common/config_info.h     |  21 ++
src/include/port.h                   |   1 +
src/include/utils/builtins.h         |   3 +
src/port/path.c                      |  30 +++
src/test/regress/expected/rules.out  |   3 +
src/tools/msvc/Mkvcbuild.pm          |   4 +-
16 files changed, 491 insertions(+), 410 deletions(-)


Re: pgsql: Add new system view, pg_config

From
Joe Conway
Date:
On 02/17/2016 09:12 AM, Joe Conway wrote:
> Add new system view, pg_config
>
> Move and refactor the underlying code for the pg_config client
> application to src/common in support of sharing it with a new
> system information SRF called pg_config() which makes the same
> information available via SQL. Additionally wrap the SRF with a
> new system view, as called pg_config.
>
> Patch by me with extensive input and review by Michael Paquier
> and additional review by Alvaro Herrera.

Hmmm, somehow this commit seems to have broken PGXS, although I'm not
yet sure how. Investigating...

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Attachment

Re: pgsql: Add new system view, pg_config

From
Joe Conway
Date:
On 02/17/2016 09:45 AM, Joe Conway wrote:
> On 02/17/2016 09:12 AM, Joe Conway wrote:
>> Add new system view, pg_config
>>
>> Move and refactor the underlying code for the pg_config client
>> application to src/common in support of sharing it with a new
>> system information SRF called pg_config() which makes the same
>> information available via SQL. Additionally wrap the SRF with a
>> new system view, as called pg_config.
>>
>> Patch by me with extensive input and review by Michael Paquier
>> and additional review by Alvaro Herrera.
>
> Hmmm, somehow this commit seems to have broken PGXS, although I'm not
> yet sure how. Investigating...

Ok, I see it now. Will fix ASAP.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Attachment

Re: pgsql: Add new system view, pg_config

From
Tom Lane
Date:
Joe Conway <mail@joeconway.com> writes:
> Add new system view, pg_config

Several members of the buildfarm are not happy with this ...
it's not immediately obvious why.

            regards, tom lane


Re: pgsql: Add new system view, pg_config

From
Joe Conway
Date:
On 02/17/2016 10:09 AM, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>> Add new system view, pg_config
>
> Several members of the buildfarm are not happy with this ...
> it's not immediately obvious why.
>
>             regards, tom lane

Sorry -- should be fixed now. I inadvertently changed the behavior of
pg_config binary when I refactored such that when individual items were
requested, the "NAME = " was prepended similar to when all configs are
emitted, which broke PGXS builds and undoubtedly other stuff too.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Attachment