the6campbells wrote:
Quote:
The 8.3 documentation makes no reference to nchar etc types and yet
you can create columns, cast and specify a national character literal.
Does Postgres 8.3 formally claim to support nchar and nchar varying
(but not nclob).
http://www.postgresql.org/docs/curre.../datatype.html |
Funky. I never realized that the following will work:
test=> CREATE TABLE testtab (
nc national character(10),
nv national character varying(10)
);
CREATE TABLE
test=> \d testtab
Table "laurenz.testtab"
Column | Type | Modifiers
--------+-----------------------+-----------
nc | character(10) |
nv | character varying(10) |
test=> INSERT INTO testtab (nc, nv) VALUES (N'nchar', 'normal');
INSERT 0 1
So PostgreSQL accepts a "national character set", but it is just
an alias for regular char, varchar or character literal.
This doubtlessly is to support SQL Standard feature F421 as
advertised in
http://www.postgresql.org/docs/8.3/s...-standard.html
I looked it up in the Standard, and the best description I found
is pretty vague in my eyes.
From ISO/IEC 9075-2 Part 2, Chapter 4.2.1, Verse 9:
The <key word>s NATIONAL CHARACTER are used to specify an
implementation-defined character set.
Special syntax (N'string') is provided for representing literals
in that character set.
So I guess it is OK to choose any old character set you choose
for "NATIONAL CHARACTER", and PostgreSQL chooses the database
character set.
PostgreSQL does not support CHARACTER LARGE OBJECT or CLOB, so it
is hardly surprising that it does not support NATIONAL CHARACTER
LARGE OBJECT.
Note that PostgreSQL does not claim to support SQL Standard Feature
T041, "basic LOB data type support".
I know NATIONAL CHARACTERS from Oracle, and I think that this is
basically a historical leftover from the days before UNICODE,
when Oracle introduced an "extra" character set to store columns
that were _not_ 7 bit ASCII. I guess that somehow made it into the
standard.
Yours,
Laurenz Albe