Skip site navigation (1) Skip section navigation (2)

Re: UTF8 problem

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: "Kai Otto" <Kai(at)medis(dot)nl>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: UTF8 problem
Date: 2011-11-18 14:52:31
Message-ID: 20111118155231.39d03fb1@anubis.defcon1 (view raw or flat)
Thread:
Lists: pgsql-novice
On Fri, 18 Nov 2011 09:53:31 +0100
"Kai Otto" <Kai(at)medis(dot)nl> wrote:

... 
> > And don't use double quotes unless imperative need.
> > As Pg is by default case insensitive, it is easier to have (and
> > write!):
> > 
> > CREATE TABLE japanesetest (
> >    id     bigint   PRIMARY KEY,
> >    name   text
> > ) WITHOUT OIDS;
> > 
> > INSERT INTO japanesetest (id, name) VALUES (2, '\x83}\x83C
> > \x83h\x83L\x83\x85\x83\x81\x83\x93\x83g (My Documents)')
> > 
> > And if primary-key-number-designation-when-inserting (that's its
> Indian
> > name:) isn't really a concern, use a bigserial instead, and
> > autoincrement
> > it using .... VALUES( default, .....
> > 
> > --
> > Interchangeable parts won't.
> 
> Without double quotes the table is not recognized:
>       SELECT * FROM JapaneseTest
> Results in:
>       ERROR:  relation "japanesetest" does not exist

Of course it don't work, this is because double-quotes render Pg case sensitive,
this is why I rewrote the whole shebang.
Retest with the (whole) above syntax.
 
> For the ID column, I am actually using uuid. But for testing this was
> easier.

IF you need a special UUID, then use it; however if it's not mandatory,
use a serial or a big serial - shorter and faster and optimized to process
for Pg instead of a char(36) for UUID.
 
> Anyway, thanks for your help. 



-- 
X-rated movies are all alike ... the only thing they leave to the
imagination is the plot.

In response to

pgsql-novice by date

Next:From: Phil DobbinDate: 2011-11-18 15:07:59
Subject: Real novice question: Roles
Previous:From: Kai OttoDate: 2011-11-18 08:53:31
Subject: Re: UTF8 problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group