{"Entry":{"collection":"func","key":"json-populate-record","name":"json_populate_record","aliases":[],"metadata":{"changed_in":["9.4"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":["json_populate_record ( base anyelement, from_json json ) → anyelement"],"removed":["json_populate_record ( base anyelement, from_json json, [, use_json_as_text bool=false] ) → anyelement"]},"status":"changed","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"83e3c2842d21578d5291a8060d1d68f74b3d044c2407500952684f6cb263606e","first_version":"9.3","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.790873+08:00","last_version":"20","name":"json_populate_record","name_key":"json_populate_record","position":16015,"present_in":["9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"json_populate_record ( base anyelement, from_json json ) → anyelement","signature_count":1,"slug":"json-populate-record","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Expands the top-level JSON object to a row having the composite type of the base argument.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-populate-record","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-populate-record","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Expands the top-level JSON object to a row having the composite type of the base argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of base is just NULL, which means that any output columns that do not match any object field will be filled with nulls. However, if base isn't NULL then the values it contains will be used for unmatched columns.","description_html":"Expands the top-level JSON object to a row having the composite type of the \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e is just \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e, which means that any output columns that do not match any object field will be filled with nulls. However, if \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e isn't \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e then the values it contains will be used for unmatched columns.","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 object to a row having the composite type of the base argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of base is just NULL, which means that any output columns that do not match any object field will be filled with nulls. However, if base isn't NULL then the values it contains will be used for unmatched columns.","description_html":"Expands the top-level JSON object to a row having the composite type of the \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e is just \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e, which means that any output columns that do not match any object field will be filled with nulls. However, if \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e isn't \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e then the values it contains will be used for unmatched columns.","description_zh":"","description_zh_html":"","examples":[{"expr":"select * from json_populate_record(null::myrowtype, '{\"a\": 1, \"b\": [\"2\", \"a b\"], \"c\": {\"d\": 4, \"e\": \"a b c\"}, \"x\": \"foo\"}')","result":" a |   b       |      c\n---+-----------+-------------\n 1 | {2,\"a b\"} | (4,\"a b c\")"}],"html":"\u003ccode class=\"function\"\u003ejson_populate_record\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003efrom_json\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejson\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"json_populate_record ( base anyelement, from_json json ) → anyelement","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-PROCESSING-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-populate-record","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_populate_record","Summary":"将顶级 JSON 对象展开为一行，其复合类型与base参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，base的值就是NULL，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果base不是NULL，那么其中包含的值将用于那些不匹配的列。","BodyHTML":"将顶级 JSON 对象展开为一行，其复合类型与\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e的值就是\u003ccode\u003eNULL\u003c/code\u003e，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e不是\u003ccode\u003eNULL\u003c/code\u003e，那么其中包含的值将用于那些不匹配的列。\u003cpre\u003ejson_populate_record ( base anyelement, from_json json ) → anyelement\u003c/pre\u003e将顶级 JSON 对象展开为一行，其复合类型与\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e的值就是\u003ccode\u003eNULL\u003c/code\u003e，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果\u003cem\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e不是\u003ccode\u003eNULL\u003c/code\u003e，那么其中包含的值将用于那些不匹配的列。","SourceRevision":"ca936764","ContentHash":"e05d4f1b09ebc379f3dbf9a1084fc714bd61e8c7b5e9d3d51f4df3e9f447e841","Payload":{"description_zh":"将顶级 JSON 对象展开为一行，其复合类型与base参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，base的值就是NULL，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果base不是NULL，那么其中包含的值将用于那些不匹配的列。","description_zh_html":"将顶级 JSON 对象展开为一行，其复合类型与\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e的值就是\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e不是\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，那么其中包含的值将用于那些不匹配的列。","signatures":[{"description_zh":"将顶级 JSON 对象展开为一行，其复合类型与base参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，base的值就是NULL，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果base不是NULL，那么其中包含的值将用于那些不匹配的列。","description_zh_html":"将顶级 JSON 对象展开为一行，其复合类型与\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e参数相同。系统会扫描该 JSON 对象，查找名称与输出行类型列名匹配的字段，并将其值插入输出中的对应列。（不对应任何输出列名的字段会被忽略。）在典型用法中，\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e的值就是\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，这意味着凡是不匹配对象字段的输出列都会被填充为空值。但是，如果\u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e不是\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e，那么其中包含的值将用于那些不匹配的列。","returns":"anyelement","text":"json_populate_record ( base anyelement, from_json json ) → anyelement","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"3c1076446bf12c577251742cfb4ebe25ae3ba73ffc5a621823a096c90016b212","Text":"json_populate_record ( base anyelement, from_json json ) → anyelement","Returns":"anyelement","Payload":{"description":"Expands the top-level JSON object to a row having the composite type of the base argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of base is just NULL, which means that any output columns that do not match any object field will be filled with nulls. However, if base isn't NULL then the values it contains will be used for unmatched columns.","description_html":"Expands the top-level JSON object to a row having the composite type of the \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e argument. The JSON object is scanned for fields whose names match column names of the output row type, and their values are inserted into those columns of the output. (Fields that do not correspond to any output column name are ignored.) In typical use, the value of \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e is just \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e, which means that any output columns that do not match any object field will be filled with nulls. However, if \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e isn't \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e then the values it contains will be used for unmatched columns.","description_zh":"","description_zh_html":"","examples":[{"expr":"select * from json_populate_record(null::myrowtype, '{\"a\": 1, \"b\": [\"2\", \"a b\"], \"c\": {\"d\": 4, \"e\": \"a b c\"}, \"x\": \"foo\"}')","result":" a |   b       |      c\n---+-----------+-------------\n 1 | {2,\"a b\"} | (4,\"a b c\")"}],"html":"\u003ccode class=\"function\"\u003ejson_populate_record\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003ebase\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003efrom_json\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejson\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"json_populate_record ( base anyelement, from_json json ) → anyelement","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
