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: Move the built-in conversions into the initial catalog data.
Date: Fri, 04 Jan 2019 00:48:11 +0000
Message-ID: <E1gfDel-0005Oy-P0@gemulon.postgresql.org> (raw)

Move the built-in conversions into the initial catalog data.

Instead of running a SQL script to create the standard conversion
functions and pg_conversion entries, put those entries into the
initial data in postgres.bki.

This shaves a few percent off the runtime of initdb, and also allows
accurate comments to be attached to the conversion functions; the
previous script labeled them with machine-generated comments that
were not quite right for multi-purpose conversion functions.
Also, we can get rid of the duplicative Makefile and MSVC perl
implementations of the generation code for that SQL script.

A functional change is that these pg_proc and pg_conversion entries
are now "pinned" by initdb.  Leaving them unpinned was perhaps a
good thing back while the conversions feature was under development,
but there seems no valid reason for it now.

Also, the conversion functions are now marked as immutable, where
before they were volatile by virtue of lacking any explicit
specification.  That seems like it was just an oversight.

To avoid using magic constants in pg_conversion.dat, extend
genbki.pl to allow encoding names to be converted, much as it
does for language, access method, etc names.

John Naylor

Discussion: https://postgr.es/m/CAJVSVGWtUqxpfAaxS88vEGvi+jKzWZb2EStu5io-UPc4p9rSJg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d33faa285b8f692549c5ec278c8e631786ae4502

Modified Files
--------------
doc/src/sgml/bki.sgml                            |   9 +-
src/backend/catalog/Makefile                     |   2 +-
src/backend/catalog/genbki.pl                    |  47 ++-
src/backend/utils/mb/conversion_procs/.gitignore |   1 -
src/backend/utils/mb/conversion_procs/Makefile   | 179 +---------
src/bin/initdb/initdb.c                          |  26 --
src/include/catalog/catversion.h                 |   2 +-
src/include/catalog/genbki.h                     |   5 +-
src/include/catalog/pg_conversion.dat            | 417 +++++++++++++++++++++++
src/include/catalog/pg_conversion.h              |  47 +--
src/include/catalog/pg_proc.dat                  | 410 +++++++++++++++++++++-
src/test/regress/expected/misc_sanity.out        |   1 -
src/tools/msvc/Install.pm                        |  39 ---
13 files changed, 912 insertions(+), 273 deletions(-)



Message-ID: <E1gfDel-0005Oy-P0@gemulon.postgresql.org>
Permalink:  ../E1gfDel-0005Oy-P0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gfDel-0005Oy-P0@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: Move the built-in conversions into the initial catalog data.
  In-Reply-To: <E1gfDel-0005Oy-P0@gemulon.postgresql.org>
  References: <E1gfDel-0005Oy-P0@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