Re: get rid of SQL_ASCII?

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get rid of SQL_ASCII?
Date: 2013-09-05 13:13:25
Message-ID: 52288375.6000308@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05.09.2013 15:47, Peter Eisentraut wrote:
> Can we consider getting rid of the SQL_ASCII server-side "encoding"? I
> don't see any good use for it, and it's often a support annoyance, and
> it leaves warts all over the code. This would presumably be a
> multi-release effort.

I think "warts all over the code" is an overstatement. There aren't that
many places in the code that care about SQL_ASCII, and they're all
related to encoding conversions.

> As a first step in accommodating users who have existing SQL_ASCII
> databases, we could change SQL_ASCII into a real encoding with
> conversion routines to all other encodings that only convert 7-bit ASCII
> characters. That way, users who use SQL_ASCII as real ASCII or don't
> care could continue to use it. Others would be forced to either set
> SQL_ASCII as the client encoding or adjust the encoding on the server.
>
> On the client side, the default libpq client "encoding" SQL_ASCII would
> be renamed to something like SAME or whatever, so the behavior would
> stay the same.
>
> Other ideas? Are there legitimate uses for SQL_ASCII?

One use is if you want to use some special encoding that's not supported
by PostgreSQL, and you want PostgreSQL to just regurgitate any strings
as is. It's not common, but would be strange to remove that capability
altogether, IMHO.

I agree it would be nice to have a "real" ASCII encoding, which only
accepts 7-bit ASCII characters. And it would be nice if "SQL_ASCII" was
called something else, like "UNDEFINED" or "BYTE_PER_CHAR", to make the
meaning more clear. But I'm not in favor of deprecating it altogether.

Also, during backend initialization there is a phase where
client_encoding has not been set yet, and we don't do any conversions
yet. That's exactly what SQL_ASCII means, so even if we get rid of
SQL_ASCII, we'd still need to have some encoding value in the backend to
mean that intermediate state.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ktm@rice.edu 2013-09-05 13:25:14 Re: get rid of SQL_ASCII?
Previous Message Merlin Moncure 2013-09-05 12:52:02 Re: get rid of SQL_ASCII?