aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/printsimple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/common/printsimple.c')
-rw-r--r--src/backend/access/common/printsimple.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/backend/access/common/printsimple.c b/src/backend/access/common/printsimple.c
index 420de65e207..5fe1c72da83 100644
--- a/src/backend/access/common/printsimple.c
+++ b/src/backend/access/common/printsimple.c
@@ -22,6 +22,7 @@
#include "catalog/pg_type.h"
#include "fmgr.h"
#include "libpq/pqformat.h"
+#include "utils/builtins.h"
/*
* At startup time, send a RowDescription message.
@@ -99,6 +100,26 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
}
break;
+ case INT4OID:
+ {
+ int32 num = DatumGetInt32(value);
+ char str[12]; /* sign, 10 digits and '\0' */
+
+ pg_ltoa(num, str);
+ pq_sendcountedtext(&buf, str, strlen(str), false);
+ }
+ break;
+
+ case INT8OID:
+ {
+ int64 num = DatumGetInt64(value);
+ char str[23]; /* sign, 21 digits and '\0' */
+
+ pg_lltoa(num, str);
+ pq_sendcountedtext(&buf, str, strlen(str), false);
+ }
+ break;
+
default:
elog(ERROR, "unsupported type OID: %u", attr->atttypid);
}