pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove dead encoding-conversion functions.
Date: Fri, 05 Jul 2019 18:17:52 +0000
Message-ID: <E1hjSmO-0000c7-89@gemulon.postgresql.org> (raw)

Remove dead encoding-conversion functions.

The code for conversions SQL_ASCII <-> MULE_INTERNAL and
SQL_ASCII <-> UTF8 was unreachable, because we long ago changed
the wrapper functions pg_do_encoding_conversion() et al so that
they have hard-wired behaviors for conversions involving SQL_ASCII.
(At least some of those fast paths date back to 2002, though it
looks like we may not have been totally consistent about this until
later.)  Given the lack of complaints, nobody is dissatisfied with
this state of affairs.  Hence, let's just remove the unreachable code.

Also, change CREATE CONVERSION so that it rejects attempts to
define such conversions.  Since we consider that SQL_ASCII represents
lack of knowledge about the encoding in use, such a conversion would
be semantically dubious even if it were reachable.

Adjust a couple of regression test cases that had randomly decided
to rely on these conversion functions rather than any other ones.

Discussion: https://postgr.es/m/41163.1559156593@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ab1a2e39b6f65b0f6a5879605ddbf12f9f50de4

Modified Files
--------------
doc/src/sgml/charset.sgml                          |  6 ++-
doc/src/sgml/func.sgml                             | 24 ---------
doc/src/sgml/ref/create_conversion.sgml            | 22 +++++---
src/backend/commands/conversioncmds.c              | 12 +++++
src/backend/utils/mb/conv.c                        | 45 ----------------
src/backend/utils/mb/conversion_procs/Makefile     |  4 +-
.../mb/conversion_procs/ascii_and_mic/Makefile     | 13 -----
.../conversion_procs/ascii_and_mic/ascii_and_mic.c | 60 ---------------------
.../mb/conversion_procs/utf8_and_ascii/Makefile    | 13 -----
.../utf8_and_ascii/utf8_and_ascii.c                | 62 ----------------------
src/include/catalog/catversion.h                   |  2 +-
src/include/catalog/pg_conversion.dat              | 12 -----
src/include/catalog/pg_proc.dat                    | 20 -------
src/include/mb/pg_wchar.h                          |  2 -
src/test/regress/expected/alter_table.out          |  6 +--
src/test/regress/expected/object_address.out       |  4 +-
src/test/regress/sql/alter_table.sql               |  4 +-
src/test/regress/sql/object_address.sql            |  2 +-
18 files changed, 44 insertions(+), 269 deletions(-)



Message-ID: <E1hjSmO-0000c7-89@gemulon.postgresql.org>
Permalink:  ../E1hjSmO-0000c7-89@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hjSmO-0000c7-89@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Remove dead encoding-conversion functions.
  In-Reply-To: <E1hjSmO-0000c7-89@gemulon.postgresql.org>
  References: <E1hjSmO-0000c7-89@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