diff options
| author | Michael Meskes <meskes@postgresql.org> | 2019-02-18 10:20:31 +0100 |
|---|---|---|
| committer | Michael Meskes <meskes@postgresql.org> | 2019-02-18 10:20:31 +0100 |
| commit | 050710b36964dee7e1b2bf6b5ef00041fd5d2787 (patch) | |
| tree | 888139b986d5d65660bd26d11c3c69d3b1d7e513 /src/interfaces/ecpg/include | |
| parent | 3fdc374b5d24b08119a91555ca2fae427af0b085 (diff) | |
| download | postgresql-050710b36964dee7e1b2bf6b5ef00041fd5d2787.tar.gz | |
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/include')
| -rw-r--r-- | src/interfaces/ecpg/include/ecpgtype.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h index 9b1f3a8066..4a7e8e781f 100644 --- a/src/interfaces/ecpg/include/ecpgtype.h +++ b/src/interfaces/ecpg/include/ecpgtype.h @@ -63,7 +63,8 @@ enum ECPGttype ECPGt_EORT, /* End of result types. */ ECPGt_NO_INDICATOR, /* no indicator */ ECPGt_string, /* trimmed (char *) type */ - ECPGt_sqlda /* C struct descriptor */ + ECPGt_sqlda, /* C struct descriptor */ + ECPGt_bytea }; /* descriptor items */ @@ -88,7 +89,7 @@ enum ECPGdtype ECPGd_cardinality }; -#define IS_SIMPLE_TYPE(type) (((type) >= ECPGt_char && (type) <= ECPGt_interval) || ((type) == ECPGt_string)) +#define IS_SIMPLE_TYPE(type) (((type) >= ECPGt_char && (type) <= ECPGt_interval) || ((type) == ECPGt_string) || ((type) == ECPGt_bytea)) /* we also have to handle different statement types */ enum ECPG_statement_type |
