pg_database
The pg_database system catalog table stores information about the available databases.
Databases are created with the CREATE DATABASE SQL command.
Unlike most system catalogs, pg_database is shared across all databases in the system.
There is only one copy of pg_database per system, not one per database.
| Column | Type | References | Description |
|---|---|---|---|
datname |
name |
— |
Database name |
datdba |
oid |
pg_authid.oid |
Owner of the database, usually the user that created it |
encoding |
integer |
— |
Character encoding for this database.
|
datcollate |
name |
— |
|
datctype |
name |
— |
|
datistemplate |
boolean |
— |
If |
datallowconn |
boolean |
— |
If |
datconnlimit |
integer |
— |
Sets the maximum number of concurrent connections that can be made to this database.
|
datlastsysoid |
oid |
— |
Last system OID in the database |
datfrozenxid |
xid |
— |
All transaction IDs (XIDs) 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 |
datminmxid |
xid |
— |
A multixact ID is used to support row locking by multiple transactions.
All 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 |
dattablespace |
oid |
pg_tablespace.oid |
The default tablespace for the database.
Within this database, all tables for which |
datacl |
aclitem[] |
— |
Database access privileges as given by |