{"Entry":{"collection":"guc","key":"array_nulls","name":"array_nulls","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Version and Platform Compatibility / Previous PostgreSQL Versions","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.1","status":"added","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":false,"fields":{"short_desc":{"from":"Enable input of NULL elements in arrays.","to":"Enables input of NULL elements in arrays."}},"from":"17","status":"changed","to":"18"}],"content_hash":"9ebb3c9c919e8689bc39684dc80725151265611f76d336b3bab57208ba4f5274","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Regression-test ETL, generated SQL, and old drivers, where parsing/quoting assumptions hide. Performance is rarely a reason to change this switch.","oltp":"Keep the modern default and repair legacy clients/SQL that depend on array_nulls. Test migration at session scope first; do not make a compatibility switch permanent cluster policy.","small":"Keep the default without a legacy requirement. If temporarily enabled, record owner, affected connections, and a removal date."},"mechanism":["Enables input of NULL elements in arrays. It can be changed at session scope, so different sessions may observe different behavior.","With the normal on value, an unquoted NULL token in an array input denotes a SQL null element; quoting it denotes the text 'NULL'. The off value restores pre-8.2 input behavior and exists only for migration of legacy clients.","Monitor and change array_nulls together with backslash_quote, escape_string_warning, standard_conforming_strings. Validate on the relevant server role and real workload, then use its user context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Keeping a compatibility switch permanently instead of fixing the client.","Testing in one session and deploying globally to unrelated applications.","Confusing parsing compatibility with data or security compatibility.","Forgetting to remove an override after the upgrade migration is complete."],"references":[{"title":"PostgreSQL 19 Beta 4: array_nulls","url":"https://www.postgresql.org/docs/19/runtime-config-compatible.html#GUC-ARRAY-NULLS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["backslash_quote","escape_string_warning","standard_conforming_strings","transform_null_equals","quote_all_identifiers","default_with_oids"],"summary":"array_nulls — Enables input of NULL elements in arrays. Observed in PG9.0–19 Beta 4; its last measured boot default is on in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.2","group":"Version and Platform Compatibility","group_slug":"compatible","imported_at":"2026-09-27T17:57:30.770378+08:00","intro_commit":{},"key":"array_nulls","last_version":"20","max_val":"","min_val":"","name":"array_nulls","position":13,"present_in":["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"],"short_desc":"This controls whether the array input parser recognizes unquoted NULL as specifying a null array element.","short_desc_zh":"","source_rev":"english-manuals:0aa053bdde4e3fa32388637453592876ea694ef3714875584027e81cac26a351","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"array_nulls","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"array_nulls","SourceRevision":"english-manuals:0aa053bdde4e3fa32388637453592876ea694ef3714875584027e81cac26a351","Facts":{"boot_val":"on","category":"Version and Platform Compatibility / Previous PostgreSQL Versions","context":"user","description":"This controls whether the array input parser recognizes unquoted NULL as specifying a null array element. By default, this is on, allowing array values containing null values to be entered. However, PostgreSQL versions before 8.2 did not support null values in arrays, and therefore would treat NULL as specifying a normal array element with the string value “NULL”. For backward compatibility with applications that require the old behavior, this variable can be turned off. Note that it is possible to create array values containing null values even when this variable is off.","doc":{"anchor":"GUC-ARRAY-NULLS","file":"runtime-config-compatible.html","lang":"en","sha256":"db2ecac1e62738d66a4932f4c8197976a349bcbf261c5b90fff740bc44867b8b","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"When turned on, unquoted NULL in an array input value means a null value; otherwise it is taken literally.","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"array_nulls","short_desc":"Enables input of NULL elements in arrays.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-ARRAY-NULLS","file":"runtime-config-compatible.html","lang":"en","sha256":"db2ecac1e62738d66a4932f4c8197976a349bcbf261c5b90fff740bc44867b8b","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"array_nulls","SourceDatabase":"center","Version":"18","Locale":"en","Title":"array_nulls","Summary":"This controls whether the array input parser recognizes unquoted NULL as specifying a null array element. By default, this is on, allowing array values containing null values to be entered. However, PostgreSQL versions before 8.2 did not support null values in arrays, and therefore would treat NULL as specifying a normal array element with the string value “NULL”. For backward compatibility with applications that require the old behavior, this variable can be turned off. Note that it is possible to create array values containing null values even when this variable is off.","BodyHTML":"\u003cp\u003eThis controls whether the array input parser recognizes unquoted NULL as specifying a null array element. By default, this is on, allowing array values containing null values to be entered. However, PostgreSQL versions before 8.2 did not support null values in arrays, and therefore would treat NULL as specifying a normal array element with the string value “NULL”. For backward compatibility with applications that require the old behavior, this variable can be turned off. Note that it is possible to create array values containing null values even when this variable is off.\u003c/p\u003e","SourceRevision":"english-manuals:0aa053bdde4e3fa32388637453592876ea694ef3714875584027e81cac26a351","ContentHash":"4bf4b48eefab34f93279ff4e40e9047417d28b90569ccfb36fe7e4c0794765cb","Payload":{"description":"This controls whether the array input parser recognizes unquoted NULL as specifying a null array element. By default, this is on, allowing array values containing null values to be entered. However, PostgreSQL versions before 8.2 did not support null values in arrays, and therefore would treat NULL as specifying a normal array element with the string value “NULL”. For backward compatibility with applications that require the old behavior, this variable can be turned off. Note that it is possible to create array values containing null values even when this variable is off."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
