Content-Length: 296335 | pFad | http://github.com/postgrespro/postgres/commit/bf5fcacdb8dde549091e8b5793e2955c4ff6856e
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 2dbdff7 commit bf5fcacCopy full SHA for bf5fcac
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/bf5fcacdb8dde549091e8b5793e2955c4ff6856e
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy
0 commit comments