aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/variable.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2019-02-18 10:20:31 +0100
committerMichael Meskes <meskes@postgresql.org>2019-02-18 10:20:31 +0100
commit050710b36964dee7e1b2bf6b5ef00041fd5d2787 (patch)
tree888139b986d5d65660bd26d11c3c69d3b1d7e513 /src/interfaces/ecpg/preproc/variable.c
parent3fdc374b5d24b08119a91555ca2fae427af0b085 (diff)
downloadpostgresql-050710b36964dee7e1b2bf6b5ef00041fd5d2787.tar.gz
postgresql-050710b36964dee7e1b2bf6b5ef00041fd5d2787.zip
Add bytea datatype to ECPG.
So far ECPG programs had to treat binary data for bytea column as 'char' type. But this meant converting from/to escaped format with PQunescapeBytea/ PQescapeBytea() and therefore forcing users to add unnecessary code and cost for the conversion in runtime. By adding a dedicated datatype for bytea most of this special handling is no longer needed. Author: Matsumura-san ("Matsumura, Ryo" <matsumura.ryo@jp.fujitsu.com>) Discussion: https://postgr.es/m/flat/03040DFF97E6E54E88D3BFEE5F5480F737A141F9@G01JPEXMBYT04
Diffstat (limited to 'src/interfaces/ecpg/preproc/variable.c')
-rw-r--r--src/interfaces/ecpg/preproc/variable.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/preproc/variable.c b/src/interfaces/ecpg/preproc/variable.c
index a953498c1c9..887d479e735 100644
--- a/src/interfaces/ecpg/preproc/variable.c
+++ b/src/interfaces/ecpg/preproc/variable.c
@@ -560,6 +560,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
break;
case ECPGt_varchar:
+ case ECPGt_bytea:
/* pointer has to get dimension 0 */
if (pointer_len)
*dimension = mm_strdup("0");