You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-25 00:16:54 +02:00
For the most part this is a direct migration of the Perl code into C. There is one important behavioral change with regard to how file permissions are handled. The Perl code tried to set ownership as it was in the manifest even when running as an unprivileged user. This usually just led to errors and frustration. The C code works like this: If a restore is run as a non-root user (the typical scenario) then all files restored will belong to the user/group executing pgBackRest. If existing files are not owned by the executing user/group then an error will result if the ownership cannot be updated to the executing user/group. In that case the file ownership will need to be updated by a privileged user before the restore can be retried. If a restore is run as the root user then pgBackRest will attempt to recreate the ownership recorded in the manifest when the backup was made. Only user/group names are stored in the manifest so the same names must exist on the restore host for this to work. If the user/group name cannot be found locally then the user/group of the PostgreSQL data directory will be used and finally root if the data directory user/group cannot be mapped to a name. Reviewed by Cynthia Shang.
69 lines
4.2 KiB
C
69 lines
4.2 KiB
C
/***********************************************************************************************************************************
|
|
PostreSQL Version Constants
|
|
***********************************************************************************************************************************/
|
|
#ifndef POSTGRES_VERSION_H
|
|
#define POSTGRES_VERSION_H
|
|
|
|
/***********************************************************************************************************************************
|
|
PostgreSQL name
|
|
***********************************************************************************************************************************/
|
|
#define PG_NAME "PostgreSQL"
|
|
|
|
/***********************************************************************************************************************************
|
|
PostgreSQL version constants
|
|
***********************************************************************************************************************************/
|
|
#define PG_VERSION_83 80300
|
|
#define PG_VERSION_84 80400
|
|
#define PG_VERSION_90 90000
|
|
#define PG_VERSION_91 90100
|
|
#define PG_VERSION_92 90200
|
|
#define PG_VERSION_93 90300
|
|
#define PG_VERSION_94 90400
|
|
#define PG_VERSION_95 90500
|
|
#define PG_VERSION_96 90600
|
|
#define PG_VERSION_10 100000
|
|
#define PG_VERSION_11 110000
|
|
|
|
#define PG_VERSION_MAX PG_VERSION_11
|
|
|
|
/***********************************************************************************************************************************
|
|
Version where various PostgreSQL capabilities were introduced
|
|
***********************************************************************************************************************************/
|
|
// application_name can be set to show the application name in pg_stat_activity
|
|
#define PG_VERSION_APPLICATION_NAME PG_VERSION_90
|
|
|
|
// pg_is_in_recovery() supported
|
|
#define PG_VERSION_HOT_STANDBY PG_VERSION_91
|
|
|
|
// pg_create_restore_point() supported
|
|
#define PG_VERSION_RESTORE_POINT PG_VERSION_91
|
|
|
|
// pause_at_recovery_target is supported
|
|
#define PG_VERSION_RECOVERY_TARGET_PAUSE PG_VERSION_91
|
|
|
|
// tablespace_map is created during backup
|
|
#define PG_VERSION_TABLESPACE_MAP PG_VERSION_95
|
|
|
|
// recovery target action supported
|
|
#define PG_VERSION_RECOVERY_TARGET_ACTION PG_VERSION_95
|
|
|
|
// xlog was renamed to wal
|
|
#define PG_VERSION_WAL_RENAME PG_VERSION_10
|
|
|
|
/***********************************************************************************************************************************
|
|
PostgreSQL version string constants for use in error messages
|
|
***********************************************************************************************************************************/
|
|
#define PG_VERSION_83_STR "8.3"
|
|
#define PG_VERSION_84_STR "8.4"
|
|
#define PG_VERSION_90_STR "9.0"
|
|
#define PG_VERSION_91_STR "9.1"
|
|
#define PG_VERSION_92_STR "9.2"
|
|
#define PG_VERSION_93_STR "9.3"
|
|
#define PG_VERSION_94_STR "9.4"
|
|
#define PG_VERSION_95_STR "9.5"
|
|
#define PG_VERSION_96_STR "9.6"
|
|
#define PG_VERSION_10_STR "10"
|
|
#define PG_VERSION_11_STR "11"
|
|
|
|
#endif
|