dbTalk Databases Forums  

8.3 accepts N char related syntax but the type is not listed assupported

comp.databases.postgresql comp.databases.postgresql


Discuss 8.3 accepts N char related syntax but the type is not listed assupported in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
the6campbells
 
Posts: n/a

Default 8.3 accepts N char related syntax but the type is not listed assupported - 04-21-2009 , 07:05 AM






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

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: 8.3 accepts N char related syntax but the type is not listed as supported - 04-22-2009 , 03:11 AM






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




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.