{"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","derived_content_hash":"620adc21590cfd30b068e59b8823feff6bd34cef8a721a9ec92c0d5e9b604fb1","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:032c908c5816b8be30e68c3a8d3558a5c0f300d089951a831470b671fb616445","versions":{"17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"75a16f67d6cacb1b60cf403da544f30a52c4b513f7ffa82c201095b35306b0f9","repair":"wiki-repair-20261023"},"signature":"json_scalar ( expression )","signature_count":1,"slug":"json-scalar","source_rev":"wiki-repair-20261023:032c908c5816b8be30e68c3a8d3558a5c0f300d089951a831470b671fb616445","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":"wiki-repair-20261023:032c908c5816b8be30e68c3a8d3558a5c0f300d089951a831470b671fb616445","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":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","doc":{"anchor":"FUNCTIONS-JSON-CREATION-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":"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":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","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":"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-CREATION-TABLE","file":"functions-json.html","sha256":"060b67147827d70ddcf5948833ddfbeada321366476016c8b8b7d68afda8045c","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-scalar","SourceDatabase":"center","Version":"18","Locale":"en","Title":"json_scalar","Summary":"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.","BodyHTML":"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.","SourceRevision":"wiki-repair-20261023:032c908c5816b8be30e68c3a8d3558a5c0f300d089951a831470b671fb616445","ContentHash":"cc6ef6379a677b5f3a3f689930e077614f75caafd135e46c1421bb9a7351e7aa","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.","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":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","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":"same-version-manual"}]}},"RequestedLocale":"en","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":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","description_zh_html":"将给定的 SQL 标量值转换为 JSON 标量值。如果输入为 NULL，则返回 SQL 空值。如果输入是数字或布尔值，则返回相应的 JSON 数字或布尔值。对于其他值，则返回 JSON 字符串。","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":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
