{"Entry":{"collection":"catalog","key":"pg_database","name":"pg_database","aliases":[],"metadata":{"changed_in":["8.0","8.1","8.2","8.4","9.0","9.3","12","15","16","17"],"changes":[{"added":["dattablespace"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Access privileges","name":"datacl","to":"Access privileges; see GRANT and REVOKE for details."}],"from":"7.4","listing":[],"order":false,"removed":["datpath"],"status":"changed","to":"8.0","types":[],"unlisted":[]},{"added":["datconnlimit"],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.0","listing":[],"order":false,"removed":[],"status":"changed","to":"8.1","types":[{"from":"int4","name":"datdba","to":"oid"}],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Access privileges; see GRANT and REVOKE for details.","name":"datacl","to":"Access privileges; see GRANT and REVOKE for details"},{"from":"If false then no one can connect to this database. This is used to protect the template0 database from being altered.","name":"datallowconn","to":"If false then no one can connect to this database. This is used to protect the template0 database from being altered"},{"from":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit.","name":"datconnlimit","to":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit"},{"from":"All rows inserted by transaction IDs before this one have been relabeled with a permanent (\"frozen\") transaction ID in this database. This is useful to check whether a database must be vacuumed soon to avoid transaction ID wrap-around problems.","name":"datfrozenxid","to":"All 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_clog to be shrunk. It is the minimum of the per-table pg_class.relfrozenxid values"},{"from":"If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one.","name":"datistemplate","to":"If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one"},{"from":"The 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.","name":"dattablespace","to":"The 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"},{"from":"Character encoding for this database","name":"encoding","to":"Character encoding for this database (pg_encoding_to_char() can translate this number to the encoding name)"}],"from":"8.1","listing":[],"order":false,"removed":["datvacuumxid"],"status":"changed","to":"8.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.2","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.3","types":[],"unlisted":[]},{"added":["datcollate","datctype"],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.3","listing":[],"order":false,"removed":[],"status":"changed","to":"8.4","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"If false then no one can connect to this database. This is used to protect the template0 database from being altered","name":"datallowconn","to":"If false then no one can connect to this database. This is used to protect the template0 database from being altered."},{"from":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit","name":"datconnlimit","to":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit."},{"from":"All 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_clog to be shrunk. It is the minimum of the per-table pg_class.relfrozenxid values","name":"datfrozenxid","to":"All 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_clog to be shrunk. It is the minimum of the per-table pg_class.relfrozenxid values."},{"from":"The 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","name":"dattablespace","to":"The 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."}],"from":"8.4","listing":[],"order":false,"removed":["datconfig"],"status":"changed","to":"9.0","types":[],"unlisted":[]},{"added":["datminmxid"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.2","listing":[],"order":false,"removed":[],"status":"changed","to":"9.3","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one","name":"datistemplate","to":"If 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."}],"from":"9.3","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.4","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.5","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.6","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"All 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_clog to be shrunk. It is the minimum of the per-table pg_class.relfrozenxid values.","name":"datfrozenxid","to":"All 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."}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"reworded","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit.","name":"datconnlimit","to":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit, -2 indicates the database is invalid."}],"from":"10","listing":[],"order":false,"removed":[],"status":"reworded","to":"11","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"hidden","from":true,"name":"oid","to":false}],"description_changed":false,"descriptions":[{"from":"Access privileges; see GRANT and REVOKE for details","name":"datacl","to":"Access privileges; see Section 5.7 for details"}],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"13","listing":[],"order":false,"removed":[],"status":"reworded","to":"14","types":[],"unlisted":[]},{"added":["datlocprovider","daticulocale","datcollversion"],"attributes":[],"description_changed":false,"descriptions":[],"from":"14","listing":[],"order":true,"removed":["datlastsysoid"],"status":"changed","to":"15","types":[{"from":"name","name":"datcollate","to":"text"},{"from":"name","name":"datctype","to":"text"}],"unlisted":[]},{"added":["daticurules"],"attributes":[],"description_changed":false,"descriptions":[],"from":"15","listing":[],"order":false,"removed":[],"status":"changed","to":"16","types":[],"unlisted":[]},{"added":["dathasloginevt","datlocale"],"attributes":[],"description_changed":true,"descriptions":[{"from":"Access privileges; see Section 5.7 for details","name":"datacl","to":"Access privileges; see Section 5.8 for details"},{"from":"Locale provider for this database: c = libc, i = icu","name":"datlocprovider","to":"Locale provider for this database: b = builtin, c = libc, i = icu"}],"from":"16","listing":[],"order":false,"removed":["daticulocale"],"status":"changed","to":"17","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Access privileges; see Section 5.8 for details","name":"datacl","to":"Access privileges; see Section 5.9 for details"}],"from":"18","listing":[],"order":false,"removed":[],"status":"reworded","to":"19","types":[],"unlisted":[]}],"column_count":18,"content_hash":"b272c6bbeb6f33a744dbe74ec83e70e3624ae615a7f76fd9f60a65de2385cb5f","first_version":"7.4","imported_at":"2026-09-30T00:40:55.488357+08:00","kind":"catalog","last_version":"20","name":"pg_database","position":20,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:3e5abd384ad7ed8127861211d1d8007a01cca1a3721991ab9e4c9902829cc888","summary":"The catalog pg_database stores information about the available databases.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_database","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_database","SourceRevision":"english-manuals:3e5abd384ad7ed8127861211d1d8007a01cca1a3721991ab9e4c9902829cc888","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Row identifier","description_zh":"","documented":true,"documented_name":"oid","hidden":false,"name":"oid","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"Database name","description_zh":"","documented":true,"documented_name":"datname","hidden":false,"name":"datname","not_null":true,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"Owner of the database, usually the user who created it","description_zh":"","documented":true,"documented_name":"datdba","hidden":false,"name":"datdba","not_null":true,"references":"pg_authid.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"Character encoding for this database (pg_encoding_to_char() can translate this number to the encoding name)","description_zh":"","documented":true,"documented_name":"encoding","hidden":false,"name":"encoding","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":5,"description":"Locale provider for this database: b = builtin, c = libc, i = icu","description_zh":"","documented":true,"documented_name":"datlocprovider","hidden":false,"name":"datlocprovider","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":6,"description":"If 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.","description_zh":"","documented":true,"documented_name":"datistemplate","hidden":false,"name":"datistemplate","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":7,"description":"If false then no one can connect to this database. This is used to protect the template0 database from being altered.","description_zh":"","documented":true,"documented_name":"datallowconn","hidden":false,"name":"datallowconn","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":8,"description":"Indicates 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.","description_zh":"","documented":true,"documented_name":"dathasloginevt","hidden":false,"name":"dathasloginevt","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":9,"description":"Sets maximum number of concurrent connections that can be made to this database. -1 means no limit, -2 indicates the database is invalid.","description_zh":"","documented":true,"documented_name":"datconnlimit","hidden":false,"name":"datconnlimit","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":10,"description":"All 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.","description_zh":"","documented":true,"documented_name":"datfrozenxid","hidden":false,"name":"datfrozenxid","not_null":true,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":11,"description":"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 pg_multixact to be shrunk. It is the minimum of the per-table pg_class.relminmxid values.","description_zh":"","documented":true,"documented_name":"datminmxid","hidden":false,"name":"datminmxid","not_null":true,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":12,"description":"The 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.","description_zh":"","documented":true,"documented_name":"dattablespace","hidden":false,"name":"dattablespace","not_null":true,"references":"pg_tablespace.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":13,"description":"LC_COLLATE for this database","description_zh":"","documented":true,"documented_name":"datcollate","hidden":false,"name":"datcollate","not_null":true,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":14,"description":"LC_CTYPE for this database","description_zh":"","documented":true,"documented_name":"datctype","hidden":false,"name":"datctype","not_null":true,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":15,"description":"Collation provider locale name for this database. If the provider is libc, datlocale is NULL; datcollate and datctype are used instead.","description_zh":"","documented":true,"documented_name":"datlocale","hidden":false,"name":"datlocale","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":16,"description":"ICU collation rules for this database","description_zh":"","documented":true,"documented_name":"daticurules","hidden":false,"name":"daticurules","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":17,"description":"Provider-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.","description_zh":"","documented":true,"documented_name":"datcollversion","hidden":false,"name":"datcollversion","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":1,"attnum":18,"description":"Access privileges; see Section 5.8 for details","description_zh":"","documented":true,"documented_name":"datacl","hidden":false,"name":"datacl","not_null":false,"references":"","type":"aclitem[]","type_modifier":-1,"type_oid":1034}],"description":"The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Consult Chapter 22 for details about the meaning of some of the parameters.\n\nUnlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database.","description_zh":"","doc":{"anchor":"id-1.10.4.17.5","file":"catalog-pg-database.html","lang":"en","sha256":"17e470912abd2506fe4ae3a4fa29b3fe82ffd744783ffb72941535a71466d716","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","datname","datdba","encoding","datlocprovider","datistemplate","datallowconn","dathasloginevt","datconnlimit","datfrozenxid","datminmxid","dattablespace","datcollate","datctype","datlocale","daticurules","datcollversion","datacl"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.17.5","file":"catalog-pg-database.html","lang":"en","sha256":"17e470912abd2506fe4ae3a4fa29b3fe82ffd744783ffb72941535a71466d716","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","datname","datdba","encoding","datlocprovider","datistemplate","datallowconn","dathasloginevt","datconnlimit","datfrozenxid","datminmxid","dattablespace","datcollate","datctype","datlocale","daticurules","datcollversion","datacl"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_database","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_database","Summary":"目录pg_database存储有关可用数据库的信息。数据库通过CREATE DATABASE命令创建。关于其中一些参数的含义的详细信息请查阅第 22 章。\n\n和大部分系统目录不同，pg_database是在集簇的所有数据库之间共享的：在一个集簇中只有一份pg_database拷贝，而不是每个数据库一份。","BodyHTML":"\u003cp\u003e目录pg_database存储有关可用数据库的信息。数据库通过CREATE DATABASE命令创建。关于其中一些参数的含义的详细信息请查阅第 22 章。\n\n和大部分系统目录不同，pg_database是在集簇的所有数据库之间共享的：在一个集簇中只有一份pg_database拷贝，而不是每个数据库一份。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"4ce554a392c2d1135385e9f6d82c6bf3a735ba41d7fb4c11f16081875513a90d","Payload":{"columns":[{"description_zh":"行标识符","name":"oid","type":"oid","zh_from":"doc"},{"description_zh":"数据库名称","name":"datname","type":"name","zh_from":"doc"},{"description_zh":"数据库的拥有者，通常是创建它的用户","name":"datdba","type":"oid","zh_from":"doc"},{"description_zh":"数据库的字符编码（pg_encoding_to_char()可以将这个数字翻译为编码名称）","name":"encoding","type":"integer","zh_from":"doc"},{"description_zh":"此数据库的区域设置提供程序：b = builtin，c = libc，i = icu","name":"datlocprovider","type":"\"char\"","zh_from":"doc"},{"description_zh":"如果为真，则此数据库可被任何具有CREATEDB权限的用户克隆；如果为假，则只有超级用户或者该数据库的属主能够克隆它。","name":"datistemplate","type":"boolean","zh_from":"doc"},{"description_zh":"如果为假则没有人能连接到这个数据库。这可以用来保护template0数据库不被修改。","name":"datallowconn","type":"boolean","zh_from":"doc"},{"description_zh":"如果此数据库定义了登录事件触发器，则为真。使用这个标志是为了避免每个后端启动时都额外查看 pg_event_trigger。该标志仅供 PostgreSQL 内部使用，不应手工修改，也不应为监控目的而读取。","name":"dathasloginevt","type":"boolean","zh_from":"doc"},{"description_zh":"设置可以连接到此数据库的最大并发连接数。-1表示没有限制，-2表示数据库无效。","name":"datconnlimit","type":"integer","zh_from":"doc"},{"description_zh":"在此事务 ID 之前的所有事务 ID，都已经在该数据库中被替换为永久的（“冻结的”）事务 ID。它用于跟踪数据库是否需要清理，以防止事务 ID 回卷，或者允许pg_xact收缩。它等于该数据库中所有表的pg_class.relfrozenxid值的最小值。","name":"datfrozenxid","type":"xid","zh_from":"doc"},{"description_zh":"在此多事务 ID 之前的所有多事务 ID，都已经在该数据库中被替换为事务 ID。它用于跟踪数据库是否需要清理，以防止多事务 ID 回卷，或者允许pg_multixact收缩。它等于该数据库中所有表的pg_class.relminmxid值的最小值。","name":"datminmxid","type":"xid","zh_from":"doc"},{"description_zh":"此数据库的默认表空间。在此数据库中，所有pg_class.reltablespace为0的表都将被存储在这个表空间中；尤其是非共享系统目录都会在其中。","name":"dattablespace","type":"oid","zh_from":"doc"},{"description_zh":"此数据库的LC_COLLATE","name":"datcollate","type":"text","zh_from":"doc"},{"description_zh":"此数据库的LC_CTYPE","name":"datctype","type":"text","zh_from":"doc"},{"description_zh":"此数据库的排序规则提供程序的区域设置名称。如果提供程序是 libc，则 datlocale 为 NULL；改用 datcollate 和 datctype。","name":"datlocale","type":"text","zh_from":"doc"},{"description_zh":"本数据库的 ICU 排序规则","name":"daticurules","type":"text","zh_from":"doc"},{"description_zh":"提供程序特有的排序规则版本。它会在创建数据库时记录下来，并在使用时接受检查，以检测可能导致数据损坏的排序规则定义更改。","name":"datcollversion","type":"text","zh_from":"doc"},{"description_zh":"访问权限，更多信息参见第 5.8 节","name":"datacl","type":"aclitem[]","zh_from":"doc"}],"description_zh":"目录pg_database存储有关可用数据库的信息。数据库通过CREATE DATABASE命令创建。关于其中一些参数的含义的详细信息请查阅第 22 章。\n\n和大部分系统目录不同，pg_database是在集簇的所有数据库之间共享的：在一个集簇中只有一份pg_database拷贝，而不是每个数据库一份。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
