Updated on 2025-05-29 GMT+08:00

GS_DATABASE_DETAILS

GS_DATABASE_DETAILS displays all information in the current PG_DATABASE system catalog, including its status (enabled or disabled).

Table 1 PG_DATABASE columns

Name

Type

Description

datname

name

Database name.

datdba

oid

Owner of the database, usually the user who created it.

encoding

integer

Character encoding for the database.

datcollate

name

Sequence used by the database.

datctype

name

Character type used by the database.

datistemplate

boolean

Specifies whether the database can be used as a template database.
  • true: The database can be used as a template database.
  • false: The database cannot be used as a template database.

datallowconn

boolean

Controls whether to allow users to connect to the database to protect the template0/templatea database from being modified.

  • true: Users can connect to the database.
  • false: Users cannot connect to the database.

datconnlimit

integer

Maximum number of concurrent connections allowed on this database. The value -1 indicates no limit.

datlastsysoid

oid

Last system OID in the database.

datfrozenxid

xid32

Tracks whether the database needs to be vacuumed to prevent transaction ID wraparound. This column is discarded in the current version. To ensure forward compatibility, this column is reserved. The datfrozenxid64 column is added to record the information.

dattablespace

oid

Default tablespace of the database.

datcompatibility

name

Database compatibility mode. Currently, five compatibility modes are supported: A, B, C, M, and PG, indicating compatibilities with Oracle Database, MySQL, Teradata, M-compatible and Postgres databases, respectively.

datacl

aclitem[]

Access permission.

datfrozenxid64

xid

Tracks whether the database needs to be vacuumed to prevent transaction ID wraparound.

datminmxid

xid

All multi-transaction IDs before this one have been replaced with a transaction ID in the database. This is used to track whether the database needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. It is the minimum value of relminmxid in 13.2.15.27 PG_CLASS of all tables in the database.

dattimezone

name

Database time zone. The default is PRC.

dattype

"char"

Database type.

  • D: common database.
  • P: PDB.

is_opened

boolean

PDB enabling status.

  • true: The PDB is enabled.
  • false: The PDB is disabled.
    NOTE:

    For the CDB, the value of this column is true.