Skip to content

sys.oldest_rollback_point_id_in_replica

Return the ID of the oldest rollback point for a replica. This function is useful when you need to roll back a database to a valid snapshot created during database replication. See also Rolling Back a Replicated Database and ROLLBACK DATABASE.

sys.oldest_rollback_point_id_in_replica('replica_name')

For example:

premdb=# select sys.oldest_rollback_point_id_in_replica('premdb_replica1');
 oldest_rollback_point_id_in_replica 
-------------------------------------
 premdb_replica1_19_12_16_23_24_17
(1 row)

This function returns a VARCHAR data type.

To check the name of a replica before using this function, query the sys.replica view. For example:

premdb=# select * from sys.replica;
-[ RECORD 1 ]------------------+------------------------------
replica_id                     | 17605
database_id                    | 17563
remote_server_id               | 16417
backup_chain_id                | premrep1
name                           | premrep1
last_replication_time          | 2020-01-24 17:45:06.456424-08
status                         | PAUSED
frequency                      | 300
alias                          | premrep1db
bandwidth_limit_bytes          | [NULL]
exclude_filter                 | [NULL]
security_mode                  | all
user_resolution_mode           | [NULL]
user_duplicate_resolution_mode | [NULL]
is_sync_users                  | [NULL]
is_sync_roles                  | [NULL]
is_sync_grants                 | [NULL]
is_sync_acls                   | [NULL]
is_sync_superusers             | [NULL]
reverse_replica                | [NULL]

Parent topic:System Functions