Re: UTF8 national character data type support WIP patch and list of open issues.

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "Arulappan, Arul Shaji *EXTERN*" <arul(at)fast(dot)au(dot)fujitsu(dot)com>, "Greg Stark" <stark(at)mit(dot)edu>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tatsuo Ishii" <ishii(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Boguk, Maksym" <Maksym(dot)Boguk(at)au(dot)fujitsu(dot)com>, "Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: UTF8 national character data type support WIP patch and list of open issues.
Date: 2013-11-05 21:25:30
Message-ID: 56B1EFF4F25747628882CDFB8B909281@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
> I looked into the Standard, and it does not have NVARCHAR.
> The type is called NATIONAL CHARACTER VARYING, NATIONAL CHAR VARYING
> or NCHAR VARYING.

OUch, that's just a mistake in my mail. You are correct.

> > I guess that the goal of this patch is to support Oracle syntax.
> But anybody trying to port CREATE TABLE statements from Oracle
> is already exposed to enough incompatibilities that the difference between
> NVARCHAR and NCHAR VARYING will not be the reason to reject PostgreSQL.
> In other words, I doubt that introducing the nonstandard NVARCHAR
> will have more benefits than drawbacks (new reserved word).

Agreed. But I'm in favor of supporting other DBMS's syntax if it doesn't
complicate the spec or implementation too much, because it can help migrate
to PostgreSQL. I understand PostgreSQL has made such efforts like PL/pgSQL
which is similar to PL/SQL, text data type, AS in SELECT statement, etc.

> But I don't think that this requires the first step that your patch
> implements, it is in fact orthogonal.

(It's not "my" patch.)

> Regarding the Standard compliant names of these data types, PostgreSQL
> already supports those. Maybe some documentation would help.
>
> I don't think that there is any need to change NCHAR even if we
> get per-column encoding, it is just syntactic sugar to support
> SQL Feature F421.

Maybe so. I guess the distinct type for NCHAR is for future extension and
user friendliness. As one user, I expect to get "national character"
instead of "char character set xxx" as output of psql \d and pg_dump when I
specified "national character" in DDL. In addition, that makes it easy to
use the pg_dump output for importing data to other DBMSs for some reason.

Regards
MauMau

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-11-05 21:25:53 Re: Add cassert-only checks against unlocked use of relations
Previous Message Tom Lane 2013-11-05 21:11:25 Re: Window functions can be created with defaults, but they don't work