{"Entry":{"collection":"func","key":"jsonb-to-recordset","name":"jsonb_to_recordset","aliases":[],"metadata":{"changed_in":[],"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"}],"content_hash":"2bb7ad521bc6dac275b819bec51ee8dec5739412d2dd91104ccb3bf2cca1f0c0","derived_content_hash":"bd6da57a265c70f0325ec8ad171853ab870a2ec1bdca392eaae2348222ed67f0","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:44b10f9325cc825d10f78dca8d9690356492b47c9b012aefa4acdbc60875eb19","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"9.4","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.817072+08:00","last_version":"20","name":"jsonb_to_recordset","name_key":"jsonb_to_recordset","position":16056,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"fa78c71faca15fba8870c6ef63a7dd18f91b1d486c853c57b648517b159d5a09","repair":"wiki-repair-20261023"},"signature":"jsonb_to_recordset ( jsonb ) → setof record","signature_count":1,"slug":"jsonb-to-recordset","source_rev":"wiki-repair-20261023:44b10f9325cc825d10f78dca8d9690356492b47c9b012aefa4acdbc60875eb19","summary":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause.","summary_zh":""}},"Definition":{"Collection":"func","Key":"jsonb-to-recordset","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"jsonb-to-recordset","SourceRevision":"wiki-repair-20261023:44b10f9325cc825d10f78dca8d9690356492b47c9b012aefa4acdbc60875eb19","Facts":{"description":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","description_html":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode class=\"type\"\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e.","description_zh":"将顶级 JSON 对象数组展开为一组由 AS 子句定义的复合类型的行。（与所有返回 record 的函数一样，调用查询必须使用 AS 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 json[b]_populate_record 的说明进行处理。","description_zh_html":"将顶级 JSON 对象数组展开为一组由 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句定义的复合类型的行。（与所有返回 \u003ccode class=\"type\"\u003erecord\u003c/code\u003e 的函数一样，调用查询必须使用 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e 的说明进行处理。","doc":{"anchor":"FUNCTIONS-JSON-PROCESSING-TABLE","file":"functions-json.html","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-json.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","version":"18.7"},{"file":"functions-json.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"31b98fa7f00387abf441728c31918bfe8b368642bceeb8bba88a73c3fbd607de","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"json","group_label":"JSON 函数和操作符","lang":"en","layout":"table-new","pages":["functions-json.html"],"prose_only":false,"signatures":[{"description":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","description_html":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode class=\"type\"\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e.","description_zh":"将顶级 JSON 对象数组展开为一组由 AS 子句定义的复合类型的行。（与所有返回 record 的函数一样，调用查询必须使用 AS 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 json[b]_populate_record 的说明进行处理。","description_zh_html":"将顶级 JSON 对象数组展开为一组由 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句定义的复合类型的行。（与所有返回 \u003ccode class=\"type\"\u003erecord\u003c/code\u003e 的函数一样，调用查询必须使用 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e 的说明进行处理。","examples":[{"expr":"select * from json_to_recordset('[{\"a\":1,\"b\":\"foo\"}, {\"a\":\"2\",\"c\":\"bar\"}]') as x(a int, b text)","result":" a |  b\n---+-----\n 1 | foo\n 2 |"}],"html":"\u003ccode class=\"function\"\u003ejsonb_to_recordset\u003c/code\u003e ( \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003esetof record\u003c/code\u003e","returns":"setof record","text":"jsonb_to_recordset ( jsonb ) → setof record","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-json.html","sha256":"a412feb14a229f1d9f14fa2d7735255aa297d5eb8f2971d744d9dfee659c7cca"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-PROCESSING-TABLE","file":"functions-json.html","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"jsonb-to-recordset","SourceDatabase":"center","Version":"18","Locale":"en","Title":"jsonb_to_recordset","Summary":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","BodyHTML":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode\u003ejson[b]_populate_record\u003c/code\u003e.","SourceRevision":"wiki-repair-20261023:44b10f9325cc825d10f78dca8d9690356492b47c9b012aefa4acdbc60875eb19","ContentHash":"8dd4df2f40fef7d2134e29e706eaaee24669027f9b5a19256fd3feff7ea31cbd","Payload":{"description":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","description_html":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode class=\"type\"\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e.","signatures":[{"description":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","description_html":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode class=\"type\"\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e.","description_zh":"将顶级 JSON 对象数组展开为一组由 AS 子句定义的复合类型的行。（与所有返回 record 的函数一样，调用查询必须使用 AS 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 json[b]_populate_record 的说明进行处理。","description_zh_html":"将顶级 JSON 对象数组展开为一组由 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句定义的复合类型的行。（与所有返回 \u003ccode class=\"type\"\u003erecord\u003c/code\u003e 的函数一样，调用查询必须使用 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e 的说明进行处理。","examples":[{"expr":"select * from json_to_recordset('[{\"a\":1,\"b\":\"foo\"}, {\"a\":\"2\",\"c\":\"bar\"}]') as x(a int, b text)","result":" a |  b\n---+-----\n 1 | foo\n 2 |"}],"html":"\u003ccode class=\"function\"\u003ejsonb_to_recordset\u003c/code\u003e ( \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003esetof record\u003c/code\u003e","returns":"setof record","text":"jsonb_to_recordset ( jsonb ) → setof record","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","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":"ea77128838617e96f5bd5d1f8c7b3d3cf518874f7d227ebcdaa04db4ac29bbfc","Text":"jsonb_to_recordset ( jsonb ) → setof record","Returns":"setof record","Payload":{"description":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause. (As with all functions returning record, the calling query must explicitly define the structure of the record with an AS clause.) Each element of the JSON array is processed as described above for json[b]_populate_record.","description_html":"Expands the top-level JSON array of objects to a set of rows having the composite type defined by an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause. (As with all functions returning \u003ccode class=\"type\"\u003erecord\u003c/code\u003e, the calling query must explicitly define the structure of the record with an \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e clause.) Each element of the JSON array is processed as described above for \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e.","description_zh":"将顶级 JSON 对象数组展开为一组由 AS 子句定义的复合类型的行。（与所有返回 record 的函数一样，调用查询必须使用 AS 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 json[b]_populate_record 的说明进行处理。","description_zh_html":"将顶级 JSON 对象数组展开为一组由 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句定义的复合类型的行。（与所有返回 \u003ccode class=\"type\"\u003erecord\u003c/code\u003e 的函数一样，调用查询必须使用 \u003ccode class=\"literal\"\u003eAS\u003c/code\u003e 子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对 \u003ccode class=\"function\"\u003ejson[b]_populate_record\u003c/code\u003e 的说明进行处理。","examples":[{"expr":"select * from json_to_recordset('[{\"a\":1,\"b\":\"foo\"}, {\"a\":\"2\",\"c\":\"bar\"}]') as x(a int, b text)","result":" a |  b\n---+-----\n 1 | foo\n 2 |"}],"html":"\u003ccode class=\"function\"\u003ejsonb_to_recordset\u003c/code\u003e ( \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003esetof record\u003c/code\u003e","returns":"setof record","text":"jsonb_to_recordset ( jsonb ) → setof record","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
