{"Entry":{"collection":"guc","key":"default_with_oids","name":"default_with_oids","aliases":[],"metadata":{"baseline":false,"boot_human":"off","boot_val":"off","category":"Version and Platform Compatibility / Previous PostgreSQL Versions","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"7.4","status":"added","to":"8.0"},{"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.4","status":"changed","to":"9.0"},{"documentation_changed":false,"fields":{},"from":"11","status":"removed","to":"12"}],"content_hash":"cc10a427261d26f20939ae7dea948f9e61ffd3bec0d6233629f040528abbebc0","context":"user","default_changed_in":[],"default_history":[{"from":"9.0","to":"11","value":"off"}],"editorial":{"advice":{"olap":"Use the same migration path as OLTP, and also verify long batches, standbys, or large-object/extension workflows; removal of the old switch does not promise identical legacy behavior.","oltp":"Do not tune or continue emitting default_with_oids on PG12+. PostgreSQL 12 removed user-table OIDs; use an identity column, sequence, or another explicit key instead. Scan every configuration layer and regression-test the application before upgrade.","small":"Delete the obsolete setting and adopt the supported replacement directly; do not emulate legacy behavior in scripts without a demonstrated compatibility requirement."},"mechanism":["Create new tables with OIDs by default. The parameter still exists in PG11 and is no longer recognized from PG12. PostgreSQL 12 removed user-table OIDs; use an identity column, sequence, or another explicit key instead.","While present, this changed CREATE TABLE without an explicit WITH/WITHOUT OIDS clause. Table OIDs were neither a durable application key nor guaranteed unique, and the feature disappeared with user-table OIDs in PostgreSQL 12.","Before upgrading, inspect lo_compat_privileges, operator_precedence_warning, synchronize_seqscans, remove the old name from configuration, ALTER SYSTEM, role/database settings, and automation templates, and verify the replacement before starting PG12 or later."],"pitfalls":["Continuing to emit unknown parameter default_with_oids on PG12+.","Deleting only the setting name without migrating dependent application behavior.","Assuming the historical default equals the replacement mechanism's default.","Missing stale entries in ALTER SYSTEM, role/database settings, or automation templates."],"references":[{"title":"PostgreSQL 11: default_with_oids","url":"https://www.postgresql.org/docs/11/runtime-config-compatible.html#GUC-DEFAULT-WITH-OIDS"}],"related":["lo_compat_privileges","operator_precedence_warning","synchronize_seqscans","standard_conforming_strings","array_nulls","backslash_quote"],"summary":"default_with_oids — Create new tables with OIDs by default. Observed in PG9.0–11; its last measured boot default is off in PG11, with user context. It was removed in PG12."},"enumvals":[],"first_version":"8.0","group":"Version and Platform Compatibility","group_slug":"compatible","imported_at":"2026-09-27T17:57:31.134507+08:00","intro_commit":{},"key":"default_with_oids","last_version":"11","max_val":"","min_val":"","name":"default_with_oids","position":106,"present_in":["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"],"short_desc":"This controls whether CREATE TABLE and CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified.","short_desc_zh":"","source_rev":"english-manuals:3aba95be26452318294a6208eac3c61c9869fbb5b3bbdd8db2fffe6a45f8e6a3","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"default_with_oids","SourceDatabase":"center","Version":"11","SourceTable":"guc","SourceKey":"default_with_oids","SourceRevision":"english-manuals:3aba95be26452318294a6208eac3c61c9869fbb5b3bbdd8db2fffe6a45f8e6a3","Facts":{"boot_val":"off","category":"Version and Platform Compatibility / Previous PostgreSQL Versions","context":"user","description":"This controls whether CREATE TABLE and CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by SELECT INTO. The parameter is off by default; in PostgreSQL 8.0 and earlier, it was on by default. The use of OIDs in user tables is considered deprecated, so most installations should leave this variable disabled. Applications that require OIDs for a particular table should specify WITH OIDS when creating the table. This variable can be enabled for compatibility with old applications that do not follow this behavior.","doc":{"anchor":"GUC-DEFAULT-WITH-OIDS","file":"runtime-config-compatible.html","lang":"en","sha256":"ecd68e9086f961a87d05ab4d21031753d01538aba964bf9a72a97f723af58351","slug":"11"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"11","min_val":null,"name":"default_with_oids","short_desc":"Create new tables with OIDs by default.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-DEFAULT-WITH-OIDS","file":"runtime-config-compatible.html","lang":"en","sha256":"ecd68e9086f961a87d05ab4d21031753d01538aba964bf9a72a97f723af58351","slug":"11"}},"MeasuredEvidence":{"metadata_version":"11"}},"Text":{"Collection":"guc","Key":"default_with_oids","SourceDatabase":"center","Version":"11","Locale":"en","Title":"default_with_oids","Summary":"This controls whether CREATE TABLE and CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by SELECT INTO. The parameter is off by default; in PostgreSQL 8.0 and earlier, it was on by default. The use of OIDs in user tables is considered deprecated, so most installations should leave this variable disabled. Applications that require OIDs for a particular table should specify WITH OIDS when creating the table. This variable can be enabled for compatibility with old applications that do not follow this behavior.","BodyHTML":"\u003cp\u003eThis controls whether CREATE TABLE and CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by SELECT INTO. The parameter is off by default; in PostgreSQL 8.0 and earlier, it was on by default. The use of OIDs in user tables is considered deprecated, so most installations should leave this variable disabled. Applications that require OIDs for a particular table should specify WITH OIDS when creating the table. This variable can be enabled for compatibility with old applications that do not follow this behavior.\u003c/p\u003e","SourceRevision":"english-manuals:3aba95be26452318294a6208eac3c61c9869fbb5b3bbdd8db2fffe6a45f8e6a3","ContentHash":"4d53b91b1a6e5e199307d84560ac456549d50c5620ff7fd46fb9446e9a18a6bd","Payload":{"description":"This controls whether CREATE TABLE and CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by SELECT INTO. The parameter is off by default; in PostgreSQL 8.0 and earlier, it was on by default. The use of OIDs in user tables is considered deprecated, so most installations should leave this variable disabled. Applications that require OIDs for a particular table should specify WITH OIDS when creating the table. This variable can be enabled for compatibility with old applications that do not follow this behavior."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","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"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
