↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

System Catalogs / System catalogs

The catalog pg_database stores information about the available databases.

Reading PG 18current·documented in 24 of 24 versions, 7.4 to 20

Kind
System catalogs
Columns in this snapshot
18
Definition source
English manual
Metadata snapshot
18.6

Columns 18

As listed in the PostgreSQL 18 manual.

ColumnTypeDescription / reference
oidoidNOT NULLRow identifier
datnamenameNOT NULLDatabase name
datdbaoidNOT NULLOwner of the database, usually the user who created it
pg_authid.oid
encodingint4NOT NULLCharacter encoding for this database (pg_encoding_to_char() can translate this number to the encoding name)
datlocprovidercharNOT NULLLocale provider for this database: b = builtin, c = libc, i = icu
datistemplateboolNOT NULLIf true, then this database can be cloned by any user with CREATEDB privileges; if false, then only superusers or the owner of the database can clone it.
datallowconnboolNOT NULLIf false then no one can connect to this database. This is used to protect the template0 database from being altered.
dathasloginevtboolNOT NULLIndicates that there are login event triggers defined for this database. This flag is used to avoid extra lookups on the pg_event_trigger table during each backend startup. This flag is used internally by PostgreSQL and should not be manually altered or read for monitoring purposes.
datconnlimitint4NOT NULLSets maximum number of concurrent connections that can be made to this database. -1 means no limit, -2 indicates the database is invalid.
datfrozenxidxidNOT NULLAll transaction IDs before this one have been replaced with a permanent (“frozen”) transaction ID in this database. This is used to track whether the database needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_xact to be shrunk. It is the minimum of the per-table pg_class.relfrozenxid values.
datminmxidxidNOT NULLAll multixact IDs before this one have been replaced with a transaction ID in this database. This is used to track whether the database needs to be vacuumed in order to prevent multixact ID wraparound or to allow pg_multixact to be shrunk. It is the minimum of the per-table pg_class.relminmxid values.
dattablespaceoidNOT NULLThe default tablespace for the database. Within this database, all tables for which pg_class.reltablespace is zero will be stored in this tablespace; in particular, all the non-shared system catalogs will be there.
pg_tablespace.oid
datcollatetextNOT NULLLC_COLLATE for this database
datctypetextNOT NULLLC_CTYPE for this database
datlocaletextCollation provider locale name for this database. If the provider is libc, datlocale is NULL; datcollate and datctype are used instead.
daticurulestextICU collation rules for this database
datcollversiontextProvider-specific version of the collation. This is recorded when the database is created and then checked when it is used, to detect changes in the collation definition that could lead to data corruption.
dataclaclitem[]Access privileges; see Section 5.8 for details
Column history across versions
Version history 17
  1. 18 → 19 reworded
  2. 16 → 17 changed
  3. 15 → 16 changed
  4. 14 → 15 changed
  5. 13 → 14 reworded
  6. 11 → 12 changed
  7. 10 → 11 reworded
  8. 9.6 → 10 reworded
  9. 9.5 → 9.6 reworded
  10. 9.3 → 9.4 reworded
  11. 9.2 → 9.3 changed
  12. 8.4 → 9.0 changed
  13. 8.3 → 8.4 changed
  14. 8.2 → 8.3 reworded
  15. 8.1 → 8.2 changed
  16. 8.0 → 8.1 changed
  17. 7.4 → 8.0 changed

Definition snapshot: english-manuals:3e5abd384ad7ed8127861211d1d… · English manual source