Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/adt/pseudotypes.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/backend/utils/adt/pseudotypes.c b/src/backend/utils/adt/pseudotypes.c
index d9329f83428..ddb1bd2b71c 100644
--- a/src/backend/utils/adt/pseudotypes.c
+++ b/src/backend/utils/adt/pseudotypes.c
@@ -212,6 +212,34 @@ void_out(PG_FUNCTION_ARGS)
PG_RETURN_CSTRING(pstrdup(""));
}
+/*
+ * void_recv - binary input routine for pseudo-type VOID.
+ *
+ * Note that since we consume no bytes, an attempt to send anything but
+ * an empty string will result in an "invalid message format" error.
+ */
+Datum
+void_recv(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_VOID();
+}
+
+/*
+ * void_send - binary output routine for pseudo-type VOID.
+ *
+ * We allow this so that "SELECT function_returning_void(...)" works
+ * even when binary output is requested.
+ */
+Datum
+void_send(PG_FUNCTION_ARGS)
+{
+ StringInfoData buf;
+
+ /* send an empty string */
+ pq_begintypsend(&buf);
+ PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
+}
+
/*
* trigger_in - input routine for pseudo-type TRIGGER.