Updated on 2023-10-23 GMT+08:00

CREATE BARRIER

Function

CREATE BARRIER creates a barrier for cluster nodes. The barrier can be used for data restoration.

Precautions

Generally, CREATE BARRIER is used only for backup and restoration. Therefore, CREATE BARRIER can be executed only in the following scenarios:

  • The database initial user can run this command.
  • If the backup and restoration mode is enabled on the CN, that is, the GUC parameter operation_mode is set to on, users with the OPRADMIN permission can run this command.

Syntax

1
CREATE BARRIER [ barrier_name  ] ;

Parameter Description

barrier_name

(Optional) Specifies the name of a barrier.

Value range: a string. It must comply with the naming convention.

Examples

1
2
3
4
5
-- Create a barrier without specifying its name.
openGauss=# CREATE BARRIER;

-- Specify the barrier name.
openGauss=# CREATE BARRIER 'barrier1';