pgsql: Add bytea datatype to ECPG. - Mailing list pgsql-committers

From Michael Meskes
Subject pgsql: Add bytea datatype to ECPG.
Date
Msg-id E1gvfE5-0005Fg-C2@gemulon.postgresql.org
Whole thread Raw
List 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.ryo@jp.fujitsu.com>)

Discussion: https://postgr.es/m/flat/03040DFF97E6E54E88D3BFEE5F5480F737A141F9@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(-)


pgsql-committers by date:

Previous
From: Etsuro Fujita
Date:
Subject: pgsql: Save PathTargets for distinct/ordered relations inroot->upper_t
Next
From: Michael Meskes
Date:
Subject: pgsql: Sync ECPG's CREATE TABLE AS statement with backend's.