{"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"}],"derived_content_hash":"8f073a0c334d6606fe307f89b6e569004ed6b928d274318fac7f1a7ee7958b77","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":"19","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"],"repair_provenance":{"original_source_revision":"english-manuals:0aa053bdde4e3fa32388637453592876ea694ef3714875584027e81cac26a351","receipt_sha256":"7055d34b57d496e609992a08c23a3ddb65c55055c04903ba9bbcd944efdbb097","repair":"wiki-repair-20261023"},"short_desc":"This controls whether the array input parser recognizes unquoted NULL as specifying a null array element.","short_desc_zh":"","source_rev":"wiki-repair-20261023:84c238ac3a19ec307b6c27caf9f059ef82ae608781f7c04a12458504e3bae998","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"array_nulls","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"array_nulls","SourceRevision":"wiki-repair-20261023:84c238ac3a19ec307b6c27caf9f059ef82ae608781f7c04a12458504e3bae998","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.","description_zh":"这个参数控制数组输入解析器是否把未用引号的 NULL 识别为一个值为空值的数组元素。默认为 on，允许输入包含空值的数组值。但是 PostgreSQL 8.2 之前的版本不支持数组中的空值，并且因此将把 NULL 当作指定一个值为字符串“NULL”的正常数组元素。为了向后兼容那些要求旧行为的应用，这个变量可以被设置为 off。 注意即使这个变量为 off 也能够创建包含空值的数组值。","description_zh_html":"\u003cp\u003e\n        这个参数控制数组输入解析器是否把未用引号的 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e 识别为一个值为空值的数组元素。默认为 \u003ccode class=\"literal\"\u003eon\u003c/code\u003e，允许输入包含空值的数组值。但是 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.2 之前的版本不支持数组中的空值，并且因此将把 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e 当作指定一个值为字符串\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eNULL\u003c/span\u003e”\u003c/span\u003e的正常数组元素。为了向后兼容那些要求旧行为的应用，这个变量可以被设置为 \u003ccode class=\"literal\"\u003eoff\u003c/code\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        注意即使这个变量为 \u003ccode class=\"literal\"\u003eoff\u003c/code\u003e 也能够创建包含空值的数组值。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-compatible.html","sha256":"01995ca3dfa6387ea699463dba924add2367e9a7fc4b9b43c1610c233e5e014b"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"bool","zh_from":"same-version-pgdoc"},"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":"wiki-repair-20261023:84c238ac3a19ec307b6c27caf9f059ef82ae608781f7c04a12458504e3bae998","ContentHash":"333b8f3e36b10b4093ece87803e11d673f6b2d5446dc21160b26c1211f6eae39","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":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","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}
