{"Entry":{"collection":"func","key":"json-object","name":"json_object","aliases":[],"metadata":{"changed_in":["16"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":["json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])"],"removed":[]},"status":"changed","to":"16"}],"content_hash":"d57935f11ef9fc98f164830ad364d01014bf1600dc884c869e4ce9725f5a0ad4","first_version":"9.4","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.789261+08:00","last_version":"20","name":"json_object","name_key":"json_object","position":16013,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","signature_count":3,"slug":"json-object","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-object","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-object","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. key_expression is a scalar expression defining the JSON key, which is converted to the text type. It cannot be NULL nor can it belong to a type that has a cast to the json type. If WITH UNIQUE KEYS is specified, there must not be any duplicate key_expression. Any pair for which the value_expression evaluates to NULL is omitted from the output if ABSENT ON NULL is specified; if NULL ON NULL is specified or the clause omitted, the key is included with value NULL.","description_html":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e is a scalar expression defining the JSON key, which is converted to the \u003ccode class=\"type\"\u003etext\u003c/code\u003e type. It cannot be \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e nor can it belong to a type that has a cast to the \u003ccode class=\"type\"\u003ejson\u003c/code\u003e type. If \u003ccode class=\"literal\"\u003eWITH UNIQUE KEYS\u003c/code\u003e is specified, there must not be any duplicate \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e. Any pair for which the \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e evaluates to \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is omitted from the output if \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified; if \u003ccode class=\"literal\"\u003eNULL ON NULL\u003c/code\u003e is specified or the clause omitted, the key is included with value \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"},"group":"json","group_label":"Json Functions And Operators","lang":"en","layout":"table-new","pages":["functions-json.html"],"prose_only":false,"signatures":[{"description":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. key_expression is a scalar expression defining the JSON key, which is converted to the text type. It cannot be NULL nor can it belong to a type that has a cast to the json type. If WITH UNIQUE KEYS is specified, there must not be any duplicate key_expression. Any pair for which the value_expression evaluates to NULL is omitted from the output if ABSENT ON NULL is specified; if NULL ON NULL is specified or the clause omitted, the key is included with value NULL.","description_html":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e is a scalar expression defining the JSON key, which is converted to the \u003ccode class=\"type\"\u003etext\u003c/code\u003e type. It cannot be \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e nor can it belong to a type that has a cast to the \u003ccode class=\"type\"\u003ejson\u003c/code\u003e type. If \u003ccode class=\"literal\"\u003eWITH UNIQUE KEYS\u003c/code\u003e is specified, there must not be any duplicate \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e. Any pair for which the \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e evaluates to \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is omitted from the output if \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified; if \u003ccode class=\"literal\"\u003eNULL ON NULL\u003c/code\u003e is specified or the clause omitted, the key is included with value \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('code' VALUE 'P123', 'title': 'Jaws')","result":"{\"code\" : \"P123\", \"title\" : \"Jaws\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e{ \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e { \u003ccode class=\"literal\"\u003eVALUE\u003c/code\u003e | ':' } \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ] }[\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e | \u003ccode class=\"literal\"\u003eABSENT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eON NULL\u003c/code\u003e\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eWITH\u003c/code\u003e | \u003ccode class=\"literal\"\u003eWITHOUT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eUNIQUE\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eKEYS\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eRETURNING\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edata_type\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ])","returns":"","text":"json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":""},{"description":"Builds a JSON object out of a text array. The array must have either exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs, or two dimensions such that each inner array has exactly two elements, which are taken as a key/value pair. All values are converted to JSON strings.","description_html":"Builds a JSON object out of a text array. The array must have either exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs, or two dimensions such that each inner array has exactly two elements, which are taken as a key/value pair. All values are converted to JSON strings.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('{a, 1, b, \"def\", c, 3.5}')","result":"{\"a\" : \"1\", \"b\" : \"def\", \"c\" : \"3.5\"}"},{"expr":"json_object('{{a, 1}, {b, \"def\"}, {c, 3.5}}')","result":"{\"a\" : \"1\", \"b\" : \"def\", \"c\" : \"3.5\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"json_object ( text[] ) → json","zh_from":""},{"description":"This form of json_object takes keys and values pairwise from separate text arrays. Otherwise it is identical to the one-argument form.","description_html":"This form of \u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e takes keys and values pairwise from separate text arrays. Otherwise it is identical to the one-argument form.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('{a,b}', '{1,2}')","result":"{\"a\": \"1\", \"b\": \"2\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ekeys\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003evalues\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"json_object ( keys text[], values text[] ) → json","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-object","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_object","Summary":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。key_expression是定义JSON键的标量表达式，会被转换为text类型。它不能为NULL，其类型也不能具有到json的类型转换。如果指定了WITH UNIQUE KEYS，则key_expression不能重复。如果指定了ABSENT ON NULL，则value_expression求值为NULL的键值对会从输出中省略；如果指定了NULL ON NULL或省略了该子句，则保留该键，并将其值设为NULL。","BodyHTML":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。\u003cem\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e是定义JSON键的标量表达式，会被转换为\u003ccode\u003etext\u003c/code\u003e类型。它不能为\u003ccode\u003eNULL\u003c/code\u003e，其类型也不能具有到\u003ccode\u003ejson\u003c/code\u003e的类型转换。如果指定了\u003ccode\u003eWITH UNIQUE KEYS\u003c/code\u003e，则\u003cem\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e不能重复。如果指定了\u003ccode\u003eABSENT ON NULL\u003c/code\u003e，则\u003cem\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e求值为\u003ccode\u003eNULL\u003c/code\u003e的键值对会从输出中省略；如果指定了\u003ccode\u003eNULL ON NULL\u003c/code\u003e或省略了该子句，则保留该键，并将其值设为\u003ccode\u003eNULL\u003c/code\u003e。\u003cpre\u003ejson_object ( [ { key_expression { VALUE | \u0026#39;:\u0026#39; } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])\u003c/pre\u003e根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。\u003cem\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e是定义JSON键的标量表达式，会被转换为\u003ccode\u003etext\u003c/code\u003e类型。它不能为\u003ccode\u003eNULL\u003c/code\u003e，其类型也不能具有到\u003ccode\u003ejson\u003c/code\u003e的类型转换。如果指定了\u003ccode\u003eWITH UNIQUE KEYS\u003c/code\u003e，则\u003cem\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e不能重复。如果指定了\u003ccode\u003eABSENT ON NULL\u003c/code\u003e，则\u003cem\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e求值为\u003ccode\u003eNULL\u003c/code\u003e的键值对会从输出中省略；如果指定了\u003ccode\u003eNULL ON NULL\u003c/code\u003e或省略了该子句，则保留该键，并将其值设为\u003ccode\u003eNULL\u003c/code\u003e。\u003cpre\u003ejson_object ( text[] ) → json\u003c/pre\u003e从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。\u003cpre\u003ejson_object ( keys text[], values text[] ) → json\u003c/pre\u003e这种形式的\u003ccode\u003ejson_object\u003c/code\u003e从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","SourceRevision":"1b5ca64c","ContentHash":"d1904c2d15210fdceb74adacdccfbddb101efcb10d5985f4dbe287e4a87ef7dc","Payload":{"description_zh":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。key_expression是定义JSON键的标量表达式，会被转换为text类型。它不能为NULL，其类型也不能具有到json的类型转换。如果指定了WITH UNIQUE KEYS，则key_expression不能重复。如果指定了ABSENT ON NULL，则value_expression求值为NULL的键值对会从输出中省略；如果指定了NULL ON NULL或省略了该子句，则保留该键，并将其值设为NULL。","description_zh_html":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。\u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e是定义JSON键的标量表达式，会被转换为\u003ccode class=\"type\"\u003etext\u003c/code\u003e类型。它不能为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，其类型也不能具有到\u003ccode class=\"type\"\u003ejson\u003c/code\u003e的类型转换。如果指定了\u003ccode class=\"literal\"\u003eWITH UNIQUE KEYS\u003c/code\u003e，则\u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e不能重复。如果指定了\u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e，则\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e求值为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e的键值对会从输出中省略；如果指定了\u003ccode class=\"literal\"\u003eNULL ON NULL\u003c/code\u003e或省略了该子句，则保留该键，并将其值设为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。","signatures":[{"description_zh":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。key_expression是定义JSON键的标量表达式，会被转换为text类型。它不能为NULL，其类型也不能具有到json的类型转换。如果指定了WITH UNIQUE KEYS，则key_expression不能重复。如果指定了ABSENT ON NULL，则value_expression求值为NULL的键值对会从输出中省略；如果指定了NULL ON NULL或省略了该子句，则保留该键，并将其值设为NULL。","description_zh_html":"根据给定的所有键值对构造 JSON 对象；如果没有给出键值对，则构造空对象。\u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e是定义JSON键的标量表达式，会被转换为\u003ccode class=\"type\"\u003etext\u003c/code\u003e类型。它不能为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，其类型也不能具有到\u003ccode class=\"type\"\u003ejson\u003c/code\u003e的类型转换。如果指定了\u003ccode class=\"literal\"\u003eWITH UNIQUE KEYS\u003c/code\u003e，则\u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e不能重复。如果指定了\u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e，则\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e求值为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e的键值对会从输出中省略；如果指定了\u003ccode class=\"literal\"\u003eNULL ON NULL\u003c/code\u003e或省略了该子句，则保留该键，并将其值设为\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。","returns":"","text":"json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":"doc"},{"description_zh":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","description_zh_html":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","returns":"json","text":"json_object ( text[] ) → json","zh_from":"doc"},{"description_zh":"这种形式的json_object从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","description_zh_html":"这种形式的\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","returns":"json","text":"json_object ( keys text[], values text[] ) → json","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"ca6e4237bd8fcc13b5242967b814cd3a58e4c8356137018c1b2600370eef0ddb","Text":"json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","Returns":"","Payload":{"description":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. key_expression is a scalar expression defining the JSON key, which is converted to the text type. It cannot be NULL nor can it belong to a type that has a cast to the json type. If WITH UNIQUE KEYS is specified, there must not be any duplicate key_expression. Any pair for which the value_expression evaluates to NULL is omitted from the output if ABSENT ON NULL is specified; if NULL ON NULL is specified or the clause omitted, the key is included with value NULL.","description_html":"Constructs a JSON object of all the key/value pairs given, or an empty object if none are given. \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e is a scalar expression defining the JSON key, which is converted to the \u003ccode class=\"type\"\u003etext\u003c/code\u003e type. It cannot be \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e nor can it belong to a type that has a cast to the \u003ccode class=\"type\"\u003ejson\u003c/code\u003e type. If \u003ccode class=\"literal\"\u003eWITH UNIQUE KEYS\u003c/code\u003e is specified, there must not be any duplicate \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e. Any pair for which the \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e evaluates to \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e is omitted from the output if \u003ccode class=\"literal\"\u003eABSENT ON NULL\u003c/code\u003e is specified; if \u003ccode class=\"literal\"\u003eNULL ON NULL\u003c/code\u003e is specified or the clause omitted, the key is included with value \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('code' VALUE 'P123', 'title': 'Jaws')","result":"{\"code\" : \"P123\", \"title\" : \"Jaws\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e{ \u003cem class=\"replaceable\"\u003e\u003ccode\u003ekey_expression\u003c/code\u003e\u003c/em\u003e { \u003ccode class=\"literal\"\u003eVALUE\u003c/code\u003e | ':' } \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue_expression\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ] }[\u003cspan class=\"optional\"\u003e, ...\u003c/span\u003e]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e | \u003ccode class=\"literal\"\u003eABSENT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eON NULL\u003c/code\u003e\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e{ \u003ccode class=\"literal\"\u003eWITH\u003c/code\u003e | \u003ccode class=\"literal\"\u003eWITHOUT\u003c/code\u003e } \u003ccode class=\"literal\"\u003eUNIQUE\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eKEYS\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ] [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eRETURNING\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edata_type\u003c/code\u003e\u003c/em\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eFORMAT JSON\u003c/code\u003e [ \u003cspan class=\"optional\"\u003e\u003ccode class=\"literal\"\u003eENCODING UTF8\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ])","returns":"","text":"json_object ( [ { key_expression { VALUE | ':' } value_expression [ FORMAT JSON [ ENCODING UTF8 ] ] }[, ...] ] [ { NULL | ABSENT } ON NULL ] [ { WITH | WITHOUT } UNIQUE [ KEYS ] ] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8 ] ] ])","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"0e8f304a03740a52c4209af7f7878194e7aafb2d950aec44ad76e8b41c61e62c","Text":"json_object ( text[] ) → json","Returns":"json","Payload":{"description":"Builds a JSON object out of a text array. The array must have either exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs, or two dimensions such that each inner array has exactly two elements, which are taken as a key/value pair. All values are converted to JSON strings.","description_html":"Builds a JSON object out of a text array. The array must have either exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs, or two dimensions such that each inner array has exactly two elements, which are taken as a key/value pair. All values are converted to JSON strings.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('{a, 1, b, \"def\", c, 3.5}')","result":"{\"a\" : \"1\", \"b\" : \"def\", \"c\" : \"3.5\"}"},{"expr":"json_object('{{a, 1}, {b, \"def\"}, {c, 3.5}}')","result":"{\"a\" : \"1\", \"b\" : \"def\", \"c\" : \"3.5\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"json_object ( text[] ) → json","zh_from":""}},{"Version":"18","Ordinal":2,"Hash":"a0711db6b37f2679c080d59e34bbb4114846a58579c3b1e198d3743fead7a772","Text":"json_object ( keys text[], values text[] ) → json","Returns":"json","Payload":{"description":"This form of json_object takes keys and values pairwise from separate text arrays. Otherwise it is identical to the one-argument form.","description_html":"This form of \u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e takes keys and values pairwise from separate text arrays. Otherwise it is identical to the one-argument form.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_object('{a,b}', '{1,2}')","result":"{\"a\": \"1\", \"b\": \"2\"}"}],"html":"\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ekeys\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003evalues\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejson\u003c/code\u003e","returns":"json","text":"json_object ( keys text[], values text[] ) → json","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
