pgsql: Add bytea datatype to ECPG.

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add bytea datatype to ECPG.
Date: 2019-02-18 09:28:37
Message-ID: E1gvfE5-0005Fg-C2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)ryo(at)jp(dot)fujitsu(dot)com>)

Discussion: https://postgr.es/m/flat/03040DFF97E6E54E88D3BFEE5F5480F737A141F9(at)G01JPEXMBYT04

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/050710b36964dee7e1b2bf6b5ef00041fd5d2787

Modified Files
--------------
doc/src/sgml/ecpg.sgml | 34 ++-
src/interfaces/ecpg/ecpglib/data.c | 129 +++++++++
src/interfaces/ecpg/ecpglib/descriptor.c | 26 +-
src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 14 +
src/interfaces/ecpg/ecpglib/execute.c | 170 +++++++++--
src/interfaces/ecpg/ecpglib/misc.c | 7 +
src/interfaces/ecpg/ecpglib/typename.c | 2 +
src/interfaces/ecpg/include/ecpgtype.h | 5 +-
src/interfaces/ecpg/preproc/ecpg.header | 2 +
src/interfaces/ecpg/preproc/ecpg.trailer | 39 ++-
src/interfaces/ecpg/preproc/type.c | 15 +-
src/interfaces/ecpg/preproc/variable.c | 1 +
src/interfaces/ecpg/test/ecpg_schedule | 1 +
src/interfaces/ecpg/test/expected/sql-bytea.c | 316 +++++++++++++++++++++
src/interfaces/ecpg/test/expected/sql-bytea.stderr | 150 ++++++++++
src/interfaces/ecpg/test/expected/sql-bytea.stdout | 8 +
src/interfaces/ecpg/test/sql/Makefile | 4 +-
src/interfaces/ecpg/test/sql/bytea.pgc | 109 +++++++
18 files changed, 983 insertions(+), 49 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Meskes 2019-02-18 11:20:07 pgsql: Sync ECPG's CREATE TABLE AS statement with backend's.
Previous Message Etsuro Fujita 2019-02-18 07:16:30 pgsql: Save PathTargets for distinct/ordered relations in root->upper_t