Re: UTF8 problem - Mailing list pgsql-novice

From Jean-Yves F. Barbier
Subject Re: UTF8 problem
Date
Msg-id 20111117153122.788e564f@anubis.defcon1
Whole thread Raw
In response to UTF8 problem  ("Kai Otto" <Kai@medis.nl>)
Responses Re: UTF8 problem
Re: UTF8 problem
List pgsql-novice
On Thu, 17 Nov 2011 13:05:39 +0100
"Kai Otto" <Kai@medis.nl> wrote:

> I have created a database using version 9.0 and set the client encoding
> to UTF* in the file postgresql.conf
>
> Runnig the query:
>
> INSERT INTO "JapaneseTest" ("ID", "name") Values(2, '\x83}\x83C
> \x83h\x83L\x83\x85\x83\x81\x83\x93\x83g (My Documents)')

Works perfectly here: Linux, Pg v9.1, pgdamin3 v1.14.0, svr+cli in UTF-8.

What is the DB collation?

> Results in:
> ERROR:  invalid byte sequence for encoding "UTF8": 0x83
> ********** Error **********
> ERROR: invalid byte sequence for encoding "UTF8": 0x83
> SQL state: 22021

== character not in repertoire

> I am running the query in pgAdmin III
> My table looks like:
> CREATE TABLE "JapaneseTest" (
>   "ID" bigint NOT NULL,
>   "name" text,
>   CONSTRAINT "JapaneseTest_pkey" PRIMARY KEY ("ID")
> ) WITH ( OIDS=FALSE );

Are there any *good* reasons to use double quotes everywhere?
(that double complicate your live)

> ALTER TABLE "JapaneseTest" OWNER TO postgres;
> GRANT ALL ON TABLE "JapaneseTest" TO public;
> GRANT ALL ON TABLE "JapaneseTest" TO postgres;

Last line is useless as you already set ownership to user 'postgres'
which gives him the whole control of this table.

--
To be loved is very demoralizing.
        -- Katharine Hepburn

pgsql-novice by date:

Previous
From: "Kai Otto"
Date:
Subject: UTF8 problem
Next
From: "Kai Otto"
Date:
Subject: Re: UTF8 problem