Re: exposing pg_controldata and pg_config as functions - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: exposing pg_controldata and pg_config as functions
Date
Msg-id 55EE2404.6030003@agliodbs.com
Whole thread Raw
In response to Re: exposing pg_controldata and pg_config as functions  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 09/06/2015 12:34 PM, Joe Conway wrote:
> To the extent that we want specific pg_controldata output in non-text
> form, we should identify which items those are and provide individual
> functions for them.

Well, I think it's pretty simple, let's take it down:

# function pg_control_control_data() returning INT, TSTZ
pg_control version number:            942
pg_control last modified: Thu 20 Aug 2015 10:05:33 AM PDT

#function pg_catversion() returning BIGINT
Catalog version number:               201409291

# have function for this, no?
Database system identifier:           6102142380557650900

# not relevant, if we can connect, it's running
Database cluster state:               shut down

# Do we have functions for all of the below?
# if not I suggest virtual table pg_checkpoint_status
# returning the below 17 columns
# that would be useful even if we have some of them
Latest checkpoint location:           0/1A1BF178
Prior checkpoint location:            0/1A1BF0D8
Latest checkpoint's REDO location:    0/1A1BF178
Latest checkpoint's REDO WAL file:    00000001000000000000001A
Latest checkpoint's TimeLineID:       1
Latest checkpoint's PrevTimeLineID:   1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:          0/2038
Latest checkpoint's NextOID:          19684
Latest checkpoint's NextMultiXactId:  1
Latest checkpoint's NextMultiOffset:  0
Latest checkpoint's oldestXID:        711
Latest checkpoint's oldestXID's DB:   1
Latest checkpoint's oldestActiveXID:  0
Latest checkpoint's oldestMultiXid:   1
Latest checkpoint's oldestMulti's DB: 1
Time of latest checkpoint:            Thu 20 Aug 2015 10:05:33 AM PDT

# Not in any way useful
Fake LSN counter for unlogged rels:   0/1

# add another system view,
# pg_recovery_state, holding the
# below 5 columns
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location:                0/0
Backup end location:                  0/0
End-of-backup record required:        no

# duplicates system settings, not needed
Current wal_level setting:            logical
Current wal_log_hints setting:        off
Current max_connections setting:      100
Current max_worker_processes setting: 8
Current max_prepared_xacts setting:   0
Current max_locks_per_xact setting:   64
Maximum data alignment:               8
Database block size:                  8192

# do we have the below anywhere else?
# this is somewhat duplicative of config info
Blocks per segment of large relation: 131072
WAL block size:                       8192
Bytes per WAL segment:                16777216
Maximum length of identifiers:        64
Maximum columns in an index:          32
Maximum size of a TOAST chunk:        1996
Size of a large-object chunk:         2048
Date/time type storage:               64-bit integers
Float4 argument passing:              by value
Float8 argument passing:              by value

# return INT function pg_data_page_checksum_version()
Data page checksum version:           0


-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: One question about security label command
Next
From: Michael Paquier
Date:
Subject: Re: New functions