Top
Enterprise Postgres 17 SP1 Userlog Operation Guide

Appendix C pgx_userlog_control Command

Name

pgx_userlog_control - View or initialize userlog_control file contents

Summary

pgx_userlog_control init -p userlog_directory [-D data_directory]
pgx_userlog_control set -p userlog_directory {-l lsn | --follow-primary} [-D data_directory]
pgx_userlog_control show -p userlog_directory [-D data_directory]

Description

When run in init mode, the userlog extraction start point is initialized to the last checkpoint point, and this point is output to standard output. The output format is a non-whitespace character concatenation of the timeline ID and the string representation of the log location, which is of type pg_lsn. Run this command only on a successful primary. The command does not result in an error if this condition is violated.

When run in set mode, the -l option sets the userlog extraction location to the specified location, and the --follow-primary option sets the extraction to start when the log location is reached, where the correct extraction file can be output. Run this command only on a stopped standby. If this condition is not met, the command does not result in an error.

In show mode, the contents of the userlog extraction control file are displayed. You may not use this mode unless you are investigating something.

Options

-p,--path=userlog_directory

Specify the directory specified by the userlog.directory parameter in postgresql.conf.

-l,--lsn=lsn

Specify the character string that was output to the standard output when pgx_userlog_control was executed in init mode on the primary. The string format is a non-whitespace character concatenation of the timeline ID and its string representation of type pg_lsn.

-D, --pgdata=data_directory

Specify the instance data directory. If this parameter is omitted, the directory specified by the PGDATA environment variable is referenced. You cannot omit both this option and the environment variable PGDATA.

Diagnosis

If there is an error, a nonzero value is returned. Returns 0 on success.

Presently, 1 is returned if the user_control or pg_control file does not exist, 2 if it exists but the contents are invalid, and 3 for any other error, but this might change in the future, so only use zero or non-zero information.

Annotation

In the show mode display, new fields may be added and the order in which they appear may change.

Privilege

Run the pgx_userlog_control command as the user who created the PostgreSQL instance. Otherwise, the command will succeed if you have privilege to move to the directory specified by the -p option and read and write to the userlog_control file in that directory.

pgx_userlog_control show display contents

The field name is followed by a colon (:), as in the following example:

The information displayed may be added or changed.

LatestExtractedFilename:00000001000000000000001C   ... (1)
OldestUserlogLSN:0/16EF3A8                         ... (2)
(1) LatestExtractedFilename: The name of the extracted file that was last extracted.
(2) OldestUserlogLSN        : Oldest WAL log location currently needed