Content-Length: 296968 | pFad | http://github.com/postgrespro/postgres/commit/e4926bf5d25161be077a3533a11c5b50ea5b2fa6
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 513242f commit e4926bfCopy full SHA for e4926bf
src/backend/utils/adt/json.c
@@ -47,6 +47,32 @@ json_in(PG_FUNCTION_ARGS)
47
PG_RETURN_TEXT_P(result);
48
}
49
50
+/*
51
+ * Output.
52
+ */
53
+Datum
54
+json_out(PG_FUNCTION_ARGS)
55
+{
56
+ /* we needn't detoast because text_to_cstring will handle that */
57
+ Datum txt = PG_GETARG_DATUM(0);
58
+
59
+ PG_RETURN_CSTRING(TextDatumGetCString(txt));
60
+}
61
62
63
+ * Binary send.
64
65
66
+json_send(PG_FUNCTION_ARGS)
67
68
+ text *t = PG_GETARG_TEXT_PP(0);
69
+ StringInfoData buf;
70
71
+ pq_begintypsend(&buf);
72
+ pq_sendtext(&buf, VARDATA_ANY(t), VARSIZE_ANY_EXHDR(t));
73
+ PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
74
75
76
/*
77
* Binary receive.
78
*/
Fetched URL: http://github.com/postgrespro/postgres/commit/e4926bf5d25161be077a3533a11c5b50ea5b2fa6
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy
0 commit comments