![]() Pg_current_xlog_location displays the current transaction log write location in the same format used by the above functions. Avoid creating multiple restore points with the same name, since recovery will stop at the first one whose name matches the recovery target. The given name can then be used with recovery_target_name to specify the point up to which recovery will proceed. Pg_create_restore_point creates a named transaction log record that can be used as recovery target, and returns the corresponding transaction log location. If there has been no transaction log activity since the last transaction log switch, pg_switch_xlog does nothing and returns the start location of the transaction log file currently in use. The return value is the ending transaction log location + 1 within the just-completed transaction log file. Pg_switch_xlog moves to the next transaction log file, allowing the current file to be archived (assuming you are using continuous archiving). After recording the ending location, the current transaction log insertion point is automatically advanced to the next transaction log file, so that the ending transaction log file can be archived immediately to complete the backup. The return value is the backup's ending transaction log location (which again can be ignored). The history file includes the label given to pg_start_backup, the starting and ending transaction log locations for the backup, and the starting and ending times of the backup. Pg_stop_backup removes the label file created by pg_start_backup, and creates a backup history file in the transaction log archive area. This forces an immediate checkpoint which will cause a spike in I/O operations, slowing any concurrently executing queries. If true, it specifies executing pg_start_backup as quickly as possible. There is an optional second parameter of type boolean. postgres=# select pg_start_backup('label_goes_here') The user can ignore this result value, but it is provided in case it is useful. (Typically this would be the name under which the backup dump file will be stored.) The function writes a backup label file ( backup_label) into the database cluster's data directory, performs a checkpoint, and then returns the backup's starting transaction log location as text. Pg_start_backup accepts an arbitrary user-defined label for the backup. Pg_xlog_location_diff( location pg_lsn, location pg_lsn)Ĭalculate the difference between two transaction log locations Pg_xlogfile_name_offset( location pg_lsn)Ĭonvert transaction log location string to file name and decimal byte offset within file Get start time of an on-line exclusive backup in progress.įorce switch to a new transaction log file (restricted to superusers)Ĭonvert transaction log location string to file name True if an on-line exclusive backup is still in progress. Prepare for performing on-line backup (restricted to superusers or replication roles)įinish performing on-line backup (restricted to superusers or replication roles) Get current transaction log write location ![]() Get current transaction log insert location Backup Control Functions NameĬreate a named point for performing restore (restricted to superusers) ![]() This works only when the built-in log collector is running, since otherwise there is no log-file manager subprocess. Pg_rotate_logfile signals the log-file manager to switch to a new output file immediately. Pg_reload_conf sends a SIGHUP signal to the server, causing configuration files to be reloaded by all server processes. The role of an active backend can be found from the usename column of the pg_stat_activity view. The process ID of an active backend can be found from the pid column of the pg_stat_activity view, or by listing the postgres processes on the server (using ps on Unix or the Task Manager on Windows). Pg_cancel_backend and pg_terminate_backend send signals ( SIGINT or SIGTERM respectively) to backend processes identified by process ID. In all other cases, you must be a superuser.Įach of these functions returns true if successful and false otherwise. You can execute this against another backend that has exactly the same role as the user calling the function. In all other cases, you must be a superuser.Ĭause server processes to reload their configuration files ![]() Server Signaling Functions NameĬancel a backend's current query. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |