{"Entry":{"collection":"guc","key":"sql_inheritance","name":"sql_inheritance","aliases":[],"metadata":{"baseline":true,"boot_human":"on","boot_val":"on","category":"Version and Platform Compatibility / Previous PostgreSQL Versions","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"8.0","status":"changed","to":"8.1"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"9.4","status":"changed","to":"9.5"},{"documentation_changed":false,"fields":{},"from":"9.6","status":"removed","to":"10"}],"content_hash":"e540c96b74d2e141f1b287bcc20c5a8c0207c00d459922ac0990a61fd7a98cc1","context":"user","default_changed_in":[],"default_history":[{"from":"9.0","to":"9.6","value":"on"}],"editorial":{"advice":{"olap":"For an upgrade or analytical estate, inventory every generated configuration before cutover. Map the old control to its successor and compare plans, throughput, WAL, or logging behavior rather than assuming the old numeric value is portable.","oltp":"Do not add this retired name to a current OLTP configuration. Translate its intent to the documented successor, test the migration under connection and write concurrency, and remove stale automation that still emits it.","small":"Delete the obsolete override after recording why it existed. On a small node, prefer the successor's default until measurements justify a new value; an unknown startup parameter can otherwise stop the server."},"mechanism":["PostgreSQL describes sql_inheritance as follows: “Causes subtables to be included by default in various commands.” It can be changed per session, which makes plan or behavior comparisons possible without changing every workload. The atlas measures it in PG9.0–9.6; boot_val is the compiled or initialized baseline, not proof of a running cluster's effective setting.","When enabled, this compatibility switch made commands operate on inheritance descendants unless ONLY was written. PostgreSQL 10 removed the switch: modern SQL uses ONLY to exclude descendants, while declarative partition pruning and constraint exclusion govern which child relations are scanned.","Read it together with constraint_exclusion, enable_partition_pruning, search_path, default_table_access_method. Check SHOW and pg_settings on the target server, verify the source and pending_restart fields, and compare workload, logs, and resource metrics before and after any change."],"pitfalls":["Treating the measured boot_val for sql_inheritance as proof of the effective value on an initialized or managed cluster.","Applying a change as though it were immediate while pg_settings reports user context.","Changing this setting in isolation without checking the linked limits, observability, and rollback path.","Copying the removed name into a modern postgresql.conf instead of migrating to its documented successor."],"references":[{"title":"PostgreSQL 9.6: sql_inheritance","url":"https://www.postgresql.org/docs/9.6/runtime-config-compatible.html#GUC-SQL-INHERITANCE"}],"related":["constraint_exclusion","enable_partition_pruning","search_path","default_table_access_method"],"summary":"sql_inheritance — Causes subtables to be included by default in various commands. Observed in PG9.0–9.6; its last measured boot default is on in PG9.6, with user context. It was removed in PG10."},"enumvals":[],"first_version":"7.4","group":"Version and Platform Compatibility","group_slug":"compatible","imported_at":"2026-09-27T17:57:31.985613+08:00","intro_commit":{},"key":"sql_inheritance","last_version":"9.6","max_val":"","min_val":"","name":"sql_inheritance","position":364,"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"],"short_desc":"This setting controls whether undecorated table references are considered to include inheritance child tables.","short_desc_zh":"","source_rev":"english-manuals:ed4e52cf191c78c86f5ae13d31e58ed779bade8280b5e1a99f9d33c2a184963d","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"sql_inheritance","SourceDatabase":"center","Version":"9.6","SourceTable":"guc","SourceKey":"sql_inheritance","SourceRevision":"english-manuals:ed4e52cf191c78c86f5ae13d31e58ed779bade8280b5e1a99f9d33c2a184963d","Facts":{"boot_val":"on","category":"Version and Platform Compatibility / Previous PostgreSQL Versions","context":"user","description":"This setting controls whether undecorated table references are considered to include inheritance child tables. The default is on, which means child tables are included (thus, a * suffix is assumed by default). If turned off, child tables are not included (thus, an ONLY prefix is assumed). The SQL standard requires child tables to be included, so the off setting is not spec-compliant, but it is provided for compatibility with PostgreSQL releases prior to 7.1. See Section 5.9 for more information. Turning sql_inheritance off is deprecated, because that behavior has been found to be error-prone as well as contrary to SQL standard. Discussions of inheritance behavior elsewhere in this manual generally assume that it is on.","doc":{"anchor":"GUC-SQL-INHERITANCE","file":"runtime-config-compatible.html","lang":"en","sha256":"50c64bfd1aa553885a33befca21d689773813535e606796f37784a19e481a50e","slug":"9.6"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"9.6","min_val":null,"name":"sql_inheritance","short_desc":"Causes subtables to be included by default in various commands.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-SQL-INHERITANCE","file":"runtime-config-compatible.html","lang":"en","sha256":"50c64bfd1aa553885a33befca21d689773813535e606796f37784a19e481a50e","slug":"9.6"}},"MeasuredEvidence":{"metadata_version":"9.6"}},"Text":{"Collection":"guc","Key":"sql_inheritance","SourceDatabase":"pgweb","Version":"9.6","Locale":"zh-Hans","Title":"sql_inheritance","Summary":"","BodyHTML":"\u003cp\u003e这个设置控制不带修饰的表引用是否被认为包括继承子表。默认值为\u003ccode\u003eon\u003c/code\u003e，即子表被包括在内（因此，默认假定有\u003ccode\u003e*\u003c/code\u003e后缀）。如果设为\u003ccode\u003eoff\u003c/code\u003e，子表不被包括（因此，假定有\u003ccode\u003eONLY\u003c/code\u003e前缀）。SQL 标准要求包括子表，因此\u003ccode\u003eoff\u003c/code\u003e设置不符合标准，但提供它是为了与 7.1 之前版本的\u003cspan\u003ePostgreSQL\u003c/span\u003e兼容。更多信息见\u003ca href=\"/docs/9.6/ddl-inherit.html\" rel=\"nofollow\"\u003e第 5.9 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e将\u003ccode\u003esql_inheritance\u003c/code\u003e关闭已被弃用，因为这种行为已被发现既容易出错又违背 SQL 标准。本手册其他地方对继承行为的讨论通常都假定它为\u003ccode\u003eon\u003c/code\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"d41dfd4f5528c0c9e33807071410476f5524be49477e3ad7e6207ecb94f9cd4d","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e这个设置控制不带修饰的表引用是否被认为包括继承子表。默认值为\u003ccode class=\"literal\"\u003eon\u003c/code\u003e，即子表被包括在内（因此，默认假定有\u003ccode class=\"literal\"\u003e*\u003c/code\u003e后缀）。如果设为\u003ccode class=\"literal\"\u003eoff\u003c/code\u003e，子表不被包括（因此，假定有\u003ccode class=\"literal\"\u003eONLY\u003c/code\u003e前缀）。SQL 标准要求包括子表，因此\u003ccode class=\"literal\"\u003eoff\u003c/code\u003e设置不符合标准，但提供它是为了与 7.1 之前版本的\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e兼容。更多信息见\u003ca href=\"/docs/9.6/ddl-inherit.html\" title=\"5.9. 继承\"\u003e第 5.9 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e将\u003ccode class=\"varname\"\u003esql_inheritance\u003c/code\u003e关闭已被弃用，因为这种行为已被发现既容易出错又违背 SQL 标准。本手册其他地方对继承行为的讨论通常都假定它为\u003ccode class=\"literal\"\u003eon\u003c/code\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["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}
