Re: pg_conversion seems rather strangely defined

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: pg_conversion seems rather strangely defined
Date: 2016-01-07 03:56:47
Message-ID: 20160107035647.GA3181278@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 05, 2016 at 01:46:51PM -0500, Tom Lane wrote:
> I do not see a lot of point in the namespacing of encoding conversions
> either. Does anyone really need or use search-path-dependent lookup of
> conversions?

I have not issued CREATE CONVERSION except to experiment, and I have never
worked in a database in which someone else had created one. Among PGXN
distributions, CREATE CONVERSION appears only in the pyrseas test suite. It
could be hard to track down testimony on real-world usage patterns, but I
envision two credible patterns. First, you could change the default search
path to "corrected_conversions, pg_catalog, $user, public" and inject fixed
versions of the system conversions. One could use that to backport commit
8d3e090. Second, you could add conversions we omit entirely, like UTF8 ->
MULE_INTERNAL. Dropping search-path-dependent lookup would remove the
supported way to fix system conversions.

> (If they do, it's probably broken anyway, since for example
> we do not trouble to re-identify the client encoding conversion functions
> when search_path changes.)

That's bad in principle, but I'll guess it's tolerable in practice. Switching
among implementations of a particular conversion might happen with O(weeks) or
longer period, like updating your system's iconv() conversion tables. I can't
easily envision one application switching between implementations over the
course of a session. (An application doing that today probably works around
the problem, perhaps with extra "SET client_encoding" calls.)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-01-07 04:29:58 Re: Regression caused by recent change to initdb?
Previous Message Stephen Frost 2016-01-07 03:29:28 Re: Multi-tenancy with RLS