{"Entry":{"collection":"func","key":"pg-database-size","name":"pg_database_size","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"14","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"15"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"19"}],"content_hash":"fca2892923fd7e469647f03b52713463c875d66f144acfe6fae30930092675d4","derived_content_hash":"da2861edab78ab7bf137cc107b6a2a973edcdc78407c4f0a0388affe617ca722","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:1646c8950e56014e9c6839a9789645eb20551c08361c711391c1d8d4b21530c6","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"8.1","group":"admin","group_label":"System Administration Functions","groups":["admin"],"imported_at":"2026-09-27T17:57:29.499052+08:00","last_version":"20","name":"pg_database_size","name_key":"pg_database_size","position":29035,"present_in":["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"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:1e6439f491d3046128ca91d389cc726ef3d8c4a869b000535f3a85e95ebf891e","receipt_sha256":"76908aec55a35a499803bdcd350bb7b6497dfb34c78a531585278da9411e7bde","repair":"wiki-repair-20261023"},"signature":"pg_database_size ( name ) → bigint","signature_count":2,"slug":"pg-database-size","source_rev":"wiki-repair-20261023:1646c8950e56014e9c6839a9789645eb20551c08361c711391c1d8d4b21530c6","summary":"Computes the total disk space used by the database with the specified name or OID.","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-database-size","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-database-size","SourceRevision":"wiki-repair-20261023:1646c8950e56014e9c6839a9789645eb20551c08361c711391c1d8d4b21530c6","Facts":{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","doc":{"anchor":"FUNCTIONS-ADMIN-DBSIZE","file":"functions-admin.html","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-admin.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","version":"18.7"},{"file":"functions-admin.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"830e894d29fec30b7c350c915fcaed4a63b24d57f2c96150bf25fa07fb43849c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"admin","group_label":"系统管理函数","lang":"en","layout":"table-new","pages":["functions-admin.html"],"prose_only":false,"signatures":[{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003ename\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( name ) → bigint","zh_from":"same-version-manual"},{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003eoid\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( oid ) → bigint","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-admin.html","sha256":"b4fab9daceb7883fd75b32b6eb5398f2bbbfbbed5c83d1b2bf99cc8d842cdaf7"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ADMIN-DBSIZE","file":"functions-admin.html","sha256":"885561d57facd49c33b44a50e320a002197d700d118784cc87d6410efadbd1f6","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-database-size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_database_size","Summary":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","BodyHTML":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","SourceRevision":"wiki-repair-20261023:1646c8950e56014e9c6839a9789645eb20551c08361c711391c1d8d4b21530c6","ContentHash":"371dce67ca2d18dfc462e4c3419dccd5c3222bbb86908af8022ff0b597b591c6","Payload":{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","signatures":[{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003ename\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( name ) → bigint","zh_from":"same-version-manual"},{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003eoid\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( oid ) → bigint","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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":[{"Version":"18","Ordinal":0,"Hash":"7a34ef465bb8c0fc5223dd7a56f242e3696a89d11af20938977718f46aef2cbf","Text":"pg_database_size ( name ) → bigint","Returns":"bigint","Payload":{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003ename\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( name ) → bigint","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":1,"Hash":"cb0b46965a76d2f0dc4904e160045adcb011592391a8b70b46434f376b6d4eef","Text":"pg_database_size ( oid ) → bigint","Returns":"bigint","Payload":{"description":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of the pg_read_all_stats role. Throws an error if the database does not exist.","description_html":"Computes the total disk space used by the database with the specified name or OID. To use this function, you must have \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e privilege on the specified database (which is granted by default) or have privileges of the \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e role. Throws an error if the database does not exist.","description_zh":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 CONNECT 权限（默认情况下授予），或者具有 pg_read_all_stats 角色的权限。如果数据库不存在，则抛出错误。","description_zh_html":"计算具有指定名称或 OID 的数据库使用的总磁盘空间。要使用此函数，您必须对指定数据库具有 \u003ccode class=\"literal\"\u003eCONNECT\u003c/code\u003e 权限（默认情况下授予），或者具有 \u003ccode class=\"literal\"\u003epg_read_all_stats\u003c/code\u003e 角色的权限。如果数据库不存在，则抛出错误。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_database_size\u003c/code\u003e ( \u003ccode class=\"type\"\u003eoid\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"pg_database_size ( oid ) → bigint","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
