]> begriffs open source - ai-pg/blob - full-docs/txt/catalog-pg-database.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / catalog-pg-database.txt
1
2 52.15. pg_database #
3
4    The catalog pg_database stores information about the available
5    databases. Databases are created with the CREATE DATABASE command.
6    Consult Chapter 22 for details about the meaning of some of the
7    parameters.
8
9    Unlike most system catalogs, pg_database is shared across all databases
10    of a cluster: there is only one copy of pg_database per cluster, not
11    one per database.
12
13    Table 52.15. pg_database Columns
14
15    Column Type
16
17    Description
18
19    oid oid
20
21    Row identifier
22
23    datname name
24
25    Database name
26
27    datdba oid (references pg_authid.oid)
28
29    Owner of the database, usually the user who created it
30
31    encoding int4
32
33    Character encoding for this database (pg_encoding_to_char() can
34    translate this number to the encoding name)
35
36    datlocprovider char
37
38    Locale provider for this database: b = builtin, c = libc, i = icu
39
40    datistemplate bool
41
42    If true, then this database can be cloned by any user with CREATEDB
43    privileges; if false, then only superusers or the owner of the database
44    can clone it.
45
46    datallowconn bool
47
48    If false then no one can connect to this database. This is used to
49    protect the template0 database from being altered.
50
51    dathasloginevt bool
52
53    Indicates that there are login event triggers defined for this
54    database. This flag is used to avoid extra lookups on the
55    pg_event_trigger table during each backend startup. This flag is used
56    internally by PostgreSQL and should not be manually altered or read for
57    monitoring purposes.
58
59    datconnlimit int4
60
61    Sets maximum number of concurrent connections that can be made to this
62    database. -1 means no limit, -2 indicates the database is invalid.
63
64    datfrozenxid xid
65
66    All transaction IDs before this one have been replaced with a permanent
67    (“frozen”) transaction ID in this database. This is used to track
68    whether the database needs to be vacuumed in order to prevent
69    transaction ID wraparound or to allow pg_xact to be shrunk. It is the
70    minimum of the per-table pg_class.relfrozenxid values.
71
72    datminmxid xid
73
74    All multixact IDs before this one have been replaced with a transaction
75    ID in this database. This is used to track whether the database needs
76    to be vacuumed in order to prevent multixact ID wraparound or to allow
77    pg_multixact to be shrunk. It is the minimum of the per-table
78    pg_class.relminmxid values.
79
80    dattablespace oid (references pg_tablespace.oid)
81
82    The default tablespace for the database. Within this database, all
83    tables for which pg_class.reltablespace is zero will be stored in this
84    tablespace; in particular, all the non-shared system catalogs will be
85    there.
86
87    datcollate text
88
89    LC_COLLATE for this database
90
91    datctype text
92
93    LC_CTYPE for this database
94
95    datlocale text
96
97    Collation provider locale name for this database. If the provider is
98    libc, datlocale is NULL; datcollate and datctype are used instead.
99
100    daticurules text
101
102    ICU collation rules for this database
103
104    datcollversion text
105
106    Provider-specific version of the collation. This is recorded when the
107    database is created and then checked when it is used, to detect changes
108    in the collation definition that could lead to data corruption.
109
110    datacl aclitem[]
111
112    Access privileges; see Section 5.8 for details