{"Entry":{"collection":"relopts","key":"toast-vacuum-truncate","name":"toast.vacuum_truncate","aliases":["vacuum_truncate"],"metadata":{"aliases":["vacuum_truncate"],"category":"TOAST tables","content_hash":"e5307ff4cc2e0607e68d1f4842ddb12fbf9f5433005934009db5deb21f9e3b1c","derived_content_hash":"660d1a43cded5ebd4fc4dbe33a59ec67756e2583da2fec89c801793504a75cf2","imported_at":"2026-09-30T17:44:22.405181+08:00","name":"toast.vacuum_truncate","name_zh":"TOAST vacuum_truncate","repair_provenance":{"original_source_revision":"","receipt_sha256":"ddf397e7d778efa29dd7fe5929ed6c6c0e3f6dc9956179760a0012d788159b8d","repair":"wiki-repair-20261023"},"slug":"toast-vacuum-truncate","source_rev":"wiki-repair-20261023:0e4d625e360a55023db1a6c6b2ec71b6e763e79668dc464f8ceb4ad3e88c9535","summary":"Per-table value for vacuum_truncate parameter. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this option."}},"Definition":{"Collection":"relopts","Key":"toast-vacuum-truncate","SourceDatabase":"center","Version":"18","SourceTable":"relopt","SourceKey":"toast-vacuum-truncate","SourceRevision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744","Facts":{"description":["Per-table value for vacuum_truncate parameter. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this option."],"description_zh":"vacuum_truncate 参数的每表取值。若 VACUUM 指定了 TRUNCATE 参数，将覆盖此选项的值。","description_zh_html":"\u003cp\u003e\n\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-vacuum.html#GUC-VACUUM-TRUNCATE\"\u003evacuum_truncate\u003c/a\u003e 参数的每表取值。若\n      \u003ca class=\"link\" href=\"/zh/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e 指定了\n      \u003ccode class=\"literal\"\u003eTRUNCATE\u003c/code\u003e 参数，将覆盖此选项的值。\n     \u003c/p\u003e\u003ch3\u003e相关全局参数\u003c/h3\u003e\u003cp\u003e\n        启用或禁用 vacuum 尝试截断表末尾的空页。默认值为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e。如果为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e，则 \u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e 和 autovacuum 会执行截断，并将这些页面占用的磁盘空间返还给操作系统。请注意，截断需要获取表上的 \u003ccode class=\"literal\"\u003eACCESS EXCLUSIVE\u003c/code\u003e 锁。如果在 \u003ca class=\"link\" href=\"/zh/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e 中指定了 \u003ccode class=\"literal\"\u003eTRUNCATE\u003c/code\u003e 参数，它将覆盖该参数的值。也可以通过修改表存储参数来为单个表覆盖此设置。\n       \u003c/p\u003e","facts":[{"label":"Applies to","value":"TOAST tables"},{"label":"Value type","value":"boolean"}],"related":[{"label":"Table option vacuum_truncate","url":"/wiki/relopts/table-vacuum-truncate/?v=18"},{"label":"Global parameter vacuum_truncate","url":"/wiki/guc/vacuum_truncate/?v=18"},{"label":"CREATE TABLE","url":"/wiki/sql/create-table/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"Local English manual 18.6","revision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744"},"sections":[{"paragraphs":["This option applies to the associated TOAST table. Set it with the toast. prefix in WITH or ALTER TABLE SET. An unset TOAST option inherits the corresponding explicitly set parent-table option.","The manual describes table and TOAST forms together. Autoanalyze does not apply to TOAST tables; only explicitly documented toast. forms are listed here."],"title":"TOAST inheritance"},{"paragraphs":["The WITH clause can specify storage parameters for tables, and for indexes associated with a UNIQUE , PRIMARY KEY , or EXCLUDE constraint. Storage parameters for indexes are documented in CREATE INDEX . The storage parameters currently available for tables are listed below. For many of these parameters, as shown, there is an additional parameter with the same name prefixed with toast. , which controls the behavior of the table's secondary TOAST table, if any (see Section 66.2 for more information about TOAST). If a table parameter value is set and the equivalent toast. parameter is not, the TOAST table will use the table's parameter value. Specifying these parameters for partitioned tables is not supported, but you may specify them for individual leaf partitions."],"title":"Common table storage rules"},{"paragraphs":["This clause specifies optional storage parameters for the new materialized view; see Storage Parameters in the CREATE TABLE documentation for more information. All parameters supported for CREATE TABLE are also supported for CREATE MATERIALIZED VIEW . See CREATE TABLE for more information."],"title":"Materialized views"},{"paragraphs":["The following same-version GUC definition explains its purpose and units. Global defaults and activation rules describe the GUC; the relation-option override rules remain those above.","Enables or disables vacuum to try to truncate off any empty pages at the end of the table. The default value is true . If true , VACUUM and autovacuum do the truncation and the disk space for the truncated pages is returned to the operating system. Note that the truncation requires an ACCESS EXCLUSIVE lock on the table. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this parameter. The setting can also be overridden for individual tables by changing table storage parameters."],"title":"Related global parameter: vacuum_truncate"}],"signature":"WITH (toast.vacuum_truncate = value)","sources":[{"label":"PostgreSQL 18 English manual","path":"sql-createtable.html","sha256":"b4d703391fe1102d0e02bd6769bef928513eb7a5542f38f7448fc77fe69e0d5b","url":"/docs/18/sql-createtable.html#RELOPTION-VACUUM-TRUNCATE"},{"label":"Related global parameter: vacuum_truncate","path":"runtime-config-vacuum.html","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","url":"/docs/18/runtime-config-vacuum.html#GUC-VACUUM-TRUNCATE"},{"label":"PostgreSQL 18 English manual","path":"sql-creatematerializedview.html","sha256":"bd8a6710c9f133afee191eb0ec345ef8c54bb54db2242621d8cb683c783a8b18","url":"/docs/18/sql-creatematerializedview.html"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-createtable.html","sha256":"c044586c69b191e0f39966b25811a0c70f12fe2bf5e7f640501e53d76ca8f775"},{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-vacuum.html","sha256":"ea621aa6ed500fc56d21868a21fd313872cec24b86caf4c8f9bdfdc804b8235f"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{"release":{"channel":"stable","label":"18.6","major":"18","ref":"Local English manual 18.6","revision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744"},"sources":[{"label":"PostgreSQL 18 English manual","path":"sql-createtable.html","sha256":"b4d703391fe1102d0e02bd6769bef928513eb7a5542f38f7448fc77fe69e0d5b","url":"/docs/18/sql-createtable.html#RELOPTION-VACUUM-TRUNCATE"},{"label":"Related global parameter: vacuum_truncate","path":"runtime-config-vacuum.html","sha256":"7047f1fa9138b97f1812532f8a905fa7479451dfd64655e029a7d387b20b22e4","url":"/docs/18/runtime-config-vacuum.html#GUC-VACUUM-TRUNCATE"},{"label":"PostgreSQL 18 English manual","path":"sql-creatematerializedview.html","sha256":"bd8a6710c9f133afee191eb0ec345ef8c54bb54db2242621d8cb683c783a8b18","url":"/docs/18/sql-creatematerializedview.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"relopts","Key":"toast-vacuum-truncate","SourceDatabase":"center","Version":"18","Locale":"en","Title":"toast.vacuum_truncate","Summary":"Per-table value for vacuum_truncate parameter. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this option.","BodyHTML":"\u003cp\u003ePer-table value for vacuum_truncate parameter. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this option.\u003c/p\u003e","SourceRevision":"eb6c2292fdf28e1b4635ab478eec3919411cdf4a6c07553387870e26201f3744","ContentHash":"8044f9e039696fceb94a6870525985c953174dafd797d28507661092f142726d","Payload":{"description":["Per-table value for vacuum_truncate parameter. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this option."],"related":[{"label":"Table option vacuum_truncate","url":"/wiki/relopts/table-vacuum-truncate/?v=18"},{"label":"Global parameter vacuum_truncate","url":"/wiki/guc/vacuum_truncate/?v=18"},{"label":"CREATE TABLE","url":"/wiki/sql/create-table/?v=18"}],"sections":[{"paragraphs":["This option applies to the associated TOAST table. Set it with the toast. prefix in WITH or ALTER TABLE SET. An unset TOAST option inherits the corresponding explicitly set parent-table option.","The manual describes table and TOAST forms together. Autoanalyze does not apply to TOAST tables; only explicitly documented toast. forms are listed here."],"title":"TOAST inheritance"},{"paragraphs":["The WITH clause can specify storage parameters for tables, and for indexes associated with a UNIQUE , PRIMARY KEY , or EXCLUDE constraint. Storage parameters for indexes are documented in CREATE INDEX . The storage parameters currently available for tables are listed below. For many of these parameters, as shown, there is an additional parameter with the same name prefixed with toast. , which controls the behavior of the table's secondary TOAST table, if any (see Section 66.2 for more information about TOAST). If a table parameter value is set and the equivalent toast. parameter is not, the TOAST table will use the table's parameter value. Specifying these parameters for partitioned tables is not supported, but you may specify them for individual leaf partitions."],"title":"Common table storage rules"},{"paragraphs":["This clause specifies optional storage parameters for the new materialized view; see Storage Parameters in the CREATE TABLE documentation for more information. All parameters supported for CREATE TABLE are also supported for CREATE MATERIALIZED VIEW . See CREATE TABLE for more information."],"title":"Materialized views"},{"paragraphs":["The following same-version GUC definition explains its purpose and units. Global defaults and activation rules describe the GUC; the relation-option override rules remain those above.","Enables or disables vacuum to try to truncate off any empty pages at the end of the table. The default value is true . If true , VACUUM and autovacuum do the truncation and the disk space for the truncated pages is returned to the operating system. Note that the truncation requires an ACCESS EXCLUSIVE lock on the table. The TRUNCATE parameter of VACUUM , if specified, overrides the value of this parameter. The setting can also be overridden for individual tables by changing table storage parameters."],"title":"Related global parameter: vacuum_truncate"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
