{"Entry":{"collection":"func","key":"jsonb-object","name":"jsonb_object","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.4","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.5"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"d32b7cd2191b7cd6b9aa3a7d20c71ad4769dcf193d7f34cb8c038c4554bdf5ed","first_version":"9.5","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.803868+08:00","last_version":"20","name":"jsonb_object","name_key":"jsonb_object","position":16036,"present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"jsonb_object ( text[] ) → jsonb","signature_count":2,"slug":"jsonb-object","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Builds a JSON object out of a text array.","summary_zh":""}},"Definition":{"Collection":"func","Key":"jsonb-object","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"jsonb-object","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"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":"","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":"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\"\u003ejsonb_object\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejsonb\u003c/code\u003e","returns":"jsonb","text":"jsonb_object ( text[] ) → jsonb","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\"\u003ejsonb_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\"\u003ejsonb\u003c/code\u003e","returns":"jsonb","text":"jsonb_object ( keys text[], values text[] ) → jsonb","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"jsonb-object","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"jsonb_object","Summary":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","BodyHTML":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。\u003cpre\u003ejsonb_object ( text[] ) → jsonb\u003c/pre\u003e从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。\u003cpre\u003ejsonb_object ( keys text[], values text[] ) → jsonb\u003c/pre\u003e这种形式的\u003ccode\u003ejson_object\u003c/code\u003e从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","SourceRevision":"ca936764","ContentHash":"6ca95a27f50498d8684d38802d9ebc47a84ee487ad107e37195df32abb359146","Payload":{"description_zh":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","description_zh_html":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","signatures":[{"description_zh":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","description_zh_html":"从 text 数组构造 JSON 对象。该数组必须是一维且包含偶数个成员，此时将成员按交替的键/值对处理；或者是二维数组，且每个内部数组恰好有两个元素，将这两个元素作为一个键/值对。所有值都转换为 JSON 字符串。","returns":"jsonb","text":"jsonb_object ( text[] ) → jsonb","zh_from":"doc"},{"description_zh":"这种形式的json_object从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","description_zh_html":"这种形式的\u003ccode class=\"function\"\u003ejson_object\u003c/code\u003e从单独的 text 数组中成对地获取键和值。除此之外，它与单参数形式相同。","returns":"jsonb","text":"jsonb_object ( keys text[], values text[] ) → jsonb","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"e3b42c47c42807ddfa4eab7bc71e6de7c208a397ea8f8989950f70d34bfaa353","Text":"jsonb_object ( text[] ) → jsonb","Returns":"jsonb","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\"\u003ejsonb_object\u003c/code\u003e ( \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003ejsonb\u003c/code\u003e","returns":"jsonb","text":"jsonb_object ( text[] ) → jsonb","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"85e830dc8ea8563bb989e7fdcc8d829ebde307f4aade72a78ebb8b0b6831d1cf","Text":"jsonb_object ( keys text[], values text[] ) → jsonb","Returns":"jsonb","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\"\u003ejsonb_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\"\u003ejsonb\u003c/code\u003e","returns":"jsonb","text":"jsonb_object ( keys text[], values text[] ) → jsonb","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
