pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add bytea datatype to ECPG.
Date: Mon, 18 Feb 2019 09:28:37 +0000
Message-ID: <E1gvfE5-0005Fg-C2@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1gvfE5-0005Fg-C2@gemulon.postgresql.org>
Permalink:  ../E1gvfE5-0005Fg-C2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gvfE5-0005Fg-C2@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: meskes@postgresql.org
  Subject: Re: pgsql: Add bytea datatype to ECPG.
  In-Reply-To: <E1gvfE5-0005Fg-C2@gemulon.postgresql.org>
  References: <E1gvfE5-0005Fg-C2@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox