We give the query a text input, cast it to json and ask for the text format output. PG's output respect the input's spacing between the key and value, while cockroachdb does not.
send
Parse {"Query": "SELECT $1::JSON"}
Bind {"ParameterFormatCodes": [0], "Parameters": [{"text":"{\"key\": \"val\"}"}]}
Describe {"ObjectType": "S"}
Execute
Sync
----
until crdb_only
ReadyForQuery
----
{"Type":"ParseComplete"}
{"Type":"BindComplete"}
{"Type":"ParameterDescription","ParameterOIDs":[3802]}
{"Type":"RowDescription","Fields":[{"Name":"jsonb","TableOID":0,"TableAttributeNumber":0,"DataTypeOID":3802,"DataTypeSize":-1,"TypeModifier":-1,"Format":0}]}
{"Type":"DataRow","Values":[{"text":"{\"key\": \"val\"}"}]}
{"Type":"CommandComplete","CommandTag":"SELECT 1"}
{"Type":"ReadyForQuery","TxStatus":"I"}
until noncrdb_only
ReadyForQuery
----
{"Type":"ParseComplete"}
{"Type":"BindComplete"}
{"Type":"ParameterDescription","ParameterOIDs":[114]}
{"Type":"RowDescription","Fields":[{"Name":"json","TableOID":0,"TableAttributeNumber":0,"DataTypeOID":114,"DataTypeSize":-1,"TypeModifier":-1,"Format":0}]}
{"Type":"DataRow","Values":[{"text":"{\"key\": \"val\"}"}]}
{"Type":"CommandComplete","CommandTag":"SELECT 1"}
{"Type":"ReadyForQuery","TxStatus":"I"}
We give the query a text input, cast it to json and ask for the text format output. PG's output respect the input's spacing between the key and value, while cockroachdb does not.
Jira issue: CRDB-23514
Epic CRDB-61001