Skip to main content
Version: 2.x

gp_pgdatabase

The gp_pgdatabase view displays the status of Apache Cloudberry segment instances and whether they are acting as the mirror or the primary. The Apache Cloudberry fault detection and recovery utilities use this view internally to identify failed segments.

columntypereferencesdescription
dbidsmallintgp_segment_configuration.dbidSystem-assigned ID. The unique identifier of a segment (or coordinator) instance.
isprimarybooleangp_segment_configuration.roleWhether or not this instance is active. Is it currently acting as the primary segment (as opposed to the mirror).
contentsmallintgp_segment_configuration.contentThe ID for the portion of data on an instance. A primary segment instance and its mirror will have the same content ID.

For a segment the value is from 0-N-1, where N is the number of segments in Apache Cloudberry.

For the coordinator, the value is -1.
validbooleangp_segment_configuration.modeWhether or not this instance is up and the mode is either s (synchronized) or n (not in sync).
definedprimarybooleangp_segment_configuration.preferred_roleWhether or not this instance was defined as the primary (as opposed to the mirror) at the time the system was initialized.