NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Updating default PostgreSQL server encoding from SQL_ASCII to UTF8



Luis Falcon <falcon%gnuhealth.org@localhost> writes:

>> Upstream -- for reasons that I don't understand -- thinks that a
>> different default is appropriate depending on the use of icu vs
>> [something less than icu]. I am not comfortable changing the default
>> for others.
>
> That makes sense. It might be good to place a warning / hint
> at the initialization process, pasting the statement for postgres on
> SQL_ASCII, so it does not go unseen. Something like:
>
> initdb: warning: enabling "trust" authentication for local connections
> initdb: hint: You can change this by editing pg_hba.conf or using the
> option -A, or --auth-local and --auth-host, the next time you run
> initdb.
> initdb: warning:
> 	The SQL_ASCII setting behaves considerably differently from the
> 	other settings. When the server character set is SQL_ASCII, the
> 	server interprets byte values 0–127 according to the ASCII
> 	standard, while byte values 128–255 are taken as uninterpreted
> 	characters. No encoding conversion will be done when the
> 	setting is SQL_ASCII. Thus, this setting is not so much a
> 	declaration that a specific encoding is in use, as a
> 	declaration of ignorance about the encoding. In most cases, if
> 	you are working with any non-ASCII data, it is unwise to use
> 	the SQL_ASCII setting because PostgreSQL will be unable to help
> 	you by converting or validating non-ASCII character

It seems to me, this is really an upstream issue, not a NetBSD issue.

> PS: I'll be doing some tests importing demo GNU Health databases (all
> unicode) I have from other systems and report if any issues on this
> matter arise.

That's great that you are trying go get GNU Health going on NetBSD.

Probably, GNU Health's "how to set up your db" should have a caution,
and pointers to pgsql upstream docs.  Perhaps at startup, warn/fail if
the actual GNU health databases are not in UTF8.

My impression is that one can specify encoding/locale things when
creating a database, and the template database is merely a default if
you don't.   Probably GNU Health's initialization stuff should be able
to script "make me a new db" with the right options, and that's probably
robust against random local configurations and random pgsql upstream
defaults.

(I do agree that SQL_ASCII seems unwise these days.)



Home | Main Index | Thread Index | Old Index