Re: UTF8 problem

From: "Kai Otto" <Kai(at)medis(dot)nl>
To: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: UTF8 problem
Date: 2011-11-17 14:52:05
Message-ID: A2F2DADB84065C41B4948C619B5E482E021AA21C@md-mail01.medis.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have created the database like this:
CREATE DATABASE postgres
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'English_United States.1252'
LC_CTYPE = 'English_United States.1252'
CONNECTION LIMIT = -1;

ALTER DEFAULT PRIVILEGES
GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER
ON TABLES
TO public;

ALTER DEFAULT PRIVILEGES
GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER
ON TABLES
TO postgres;

Does that help?

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org [mailto:pgsql-novice-
> owner(at)postgresql(dot)org] On Behalf Of Jean-Yves F. Barbier
> Sent: Thursday, November 17, 2011 3:31 PM
> To: pgsql-novice(at)postgresql(dot)org
> Subject: Re: [NOVICE] UTF8 problem
>
> On Thu, 17 Nov 2011 13:05:39 +0100
> "Kai Otto" <Kai(at)medis(dot)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
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2011-11-17 15:53:35 Re: How can I show more potential query plans, other than the default one?
Previous Message Kai Otto 2011-11-17 14:48:37 Re: UTF8 problem