{"Entry":{"collection":"func","key":"json-scalar","name":"json_scalar","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"16","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"17"}],"content_hash":"259cc63e67d403bd509036d341ad7e409a31480a66d42cfa231a128623c503d7","first_version":"17","group":"json","group_label":"Json Functions And Operators","groups":["json"],"imported_at":"2026-09-14T21:49:48.792811+08:00","last_version":"20","name":"json_scalar","name_key":"json_scalar","position":16018,"present_in":["17","18","19","20"],"signature":"json_scalar ( expression )","signature_count":1,"slug":"json-scalar","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Converts a given SQL scalar value into a JSON scalar value.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-scalar","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-scalar","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","description_html":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","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":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","description_html":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_scalar(123.45)","result":"123.45"},{"expr":"json_scalar(CURRENT_TIMESTAMP)","result":"\"2022-05-10T10:51:04.62128-04:00\""}],"html":"\u003ccode class=\"function\"\u003ejson_scalar\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e )","returns":"","text":"json_scalar ( expression )","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-JSON-CREATION-TABLE","file":"functions-json.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-scalar","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_scalar","Summary":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","BodyHTML":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。\u003cpre\u003ejson_scalar ( expression )\u003c/pre\u003e将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","SourceRevision":"ca936764","ContentHash":"240418dd2400fe049844172aec1c8e13020ef3e85794e7dce7a4647a92d2807d","Payload":{"description_zh":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","signatures":[{"description_zh":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回SQL空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","returns":"","text":"json_scalar ( expression )","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"b76c7ae6d3647a0479580d230eccca54f063d4daf199f56b5fa20979d20598dc","Text":"json_scalar ( expression )","Returns":"","Payload":{"description":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","description_html":"Converts a given SQL scalar value into a JSON scalar value. If the input is NULL, an SQL null is returned. If the input is number or a boolean value, a corresponding JSON number or boolean value is returned. For any other value, a JSON string is returned.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_scalar(123.45)","result":"123.45"},{"expr":"json_scalar(CURRENT_TIMESTAMP)","result":"\"2022-05-10T10:51:04.62128-04:00\""}],"html":"\u003ccode class=\"function\"\u003ejson_scalar\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eexpression\u003c/code\u003e\u003c/em\u003e )","returns":"","text":"json_scalar ( expression )","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
