{"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","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"],"signature":"jsonb_to_recordset ( jsonb ) → setof record","signature_count":1,"slug":"jsonb-to-recordset","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-JSON-PROCESSING-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":"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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-PROCESSING-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"jsonb-to-recordset","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"jsonb_to_recordset","Summary":"将顶级JSON对象数组展开为一组由AS子句定义的复合类型的行。（与所有返回record的函数一样，调用查询必须使用AS子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对json[b]_populate_record的说明进行处理。","BodyHTML":"将顶级JSON对象数组展开为一组由\u003ccode\u003eAS\u003c/code\u003e子句定义的复合类型的行。（与所有返回\u003ccode\u003erecord\u003c/code\u003e的函数一样，调用查询必须使用\u003ccode\u003eAS\u003c/code\u003e子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对\u003ccode\u003ejson[b]_populate_record\u003c/code\u003e的说明进行处理。\u003cpre\u003ejsonb_to_recordset ( jsonb ) → setof record\u003c/pre\u003e将顶级JSON对象数组展开为一组由\u003ccode\u003eAS\u003c/code\u003e子句定义的复合类型的行。（与所有返回\u003ccode\u003erecord\u003c/code\u003e的函数一样，调用查询必须使用\u003ccode\u003eAS\u003c/code\u003e子句显式定义记录的结构。）JSON 数组中的每个元素都按照上文对\u003ccode\u003ejson[b]_populate_record\u003c/code\u003e的说明进行处理。","SourceRevision":"ca936764","ContentHash":"73d2ad06fa0f28da80aabc80ca28bfec2b622df86a2d05b645c2e5a339d9c7e3","Payload":{"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的说明进行处理。","signatures":[{"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的说明进行处理。","returns":"setof record","text":"jsonb_to_recordset ( jsonb ) → setof record","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":"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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
