Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9Vn4-00018s-R1 for pgsql-it-generale@arkaria.postgresql.org; Wed, 14 Aug 2013 07:46:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V9Vn3-0001zZ-2a for pgsql-it-generale@arkaria.postgresql.org; Wed, 14 Aug 2013 07:46:45 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9Vn2-0001zS-8m for pgsql-it-generale@postgresql.org; Wed, 14 Aug 2013 07:46:44 +0000 Received: from mrw-3-xc.mail.tiscali.it ([195.130.225.206]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9Vlx-0006Wq-8P for pgsql-it-generale@postgresql.org; Wed, 14 Aug 2013 07:45:40 +0000 Received: from [10.39.115.31] by mrw-3 with esmtp (Exim) id 1V9Vlw-00086P-PD; Wed, 14 Aug 2013 07:45:36 +0000 Received: from ps-wm11.mc.tiscali.sys (10.39.75.211) by smtp-ps-1.mail.tiscali.sys (8.5.142) id 51E61F94004B329E for pgsql-it-generale@postgresql.org; Wed, 14 Aug 2013 09:45:28 +0200 Message-ID: <8015825.7251376466328701.JavaMail.defaultUser@defaultHost> Date: Wed, 14 Aug 2013 09:45:28 +0200 (CEST) From: "ciifrancesco@tiscali.it" Reply-To: "ciifrancesco@tiscali.it" To: Subject: =?UTF-8?Q?Novit=C3=A0_--_problema_Cinese_in_DB_UTF8?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_391_24636741.1376466328701" xOriginalSenderIP: 140.101.16.142 X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-it-generale Precedence: bulk Sender: pgsql-it-generale-owner@postgresql.org ------=_Part_391_24636741.1376466328701 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Allora, ho fatto i seguenti passi:=20 1. ho modificato i template in modo che anche essi siano: Name | Owner | Encoding | Collate | Ctype | Access privilege= s ----------+-------+----------+-------------+-------------+-----------------= -- postgres | pedro | UTF8 | it_IT.UTF-8 | it_IT.UTF-8 | mioDB | pedro | UTF8 | it_IT.UTF-8 | it_IT.UTF-8 | template0 | pedro | UTF8 | it_IT.UTF-8 | it_IT.UTF-8 | template1 | pedro | UTF8 | it_IT.UTF-8 | it_IT.UTF-8 | =20 Non mi piacciono i nomi di nazioni o lingue per del testo universale, ma da= quanto ho capito, qualsiasi collate o Ctype/Collate che finisce per UTF-8 = va bene (+ dettagli nella guida in PS che metto perch=C3=A9 pu=C3=B2 essere= utile a qualcuno). 2. ho fatto un dump. Siccome non avevo memoria sufficiente, ho dovuto farlo= compresso: pg_dump dbname | gzip > filename.gz3. ho quindi eliminato mioDB e l'ho ricr= eato come si vede sopra, con collate e Ctype corretti 4. quindi cerco di rimettere i dati nel DB: gunzip -c filename.gz | psql dbnamema il DB risulta vuoto a dispetto della = lunghezza dell'operazione e l'assenza di errori. Usare il metodo=20 cat filename.gz | gunzip | psql dbnamenon cambia niente. Entrambi sono su h= ttp://www.postgresql.org/docs/9.1/static/backup-dump.html mioDB=3D# \dv No relations found. Se avete qualche idea... Francesco PS per convertire i template d=C3=B2 questa procedura, che in italiano non fac= ilmente si trova. Devo fare una forte critica a google, che nonostante aves= si fatto delle ricerche usando parole chiave simili, non mi ha portato alle= pagine con questa procedura. Credo sia a causa delle ricerche personalizza= te che fanno arrivare utenti diversi a risultati diversi, ma cos=C3=AC face= ndo oscurano una parte del web o la rendono pi=C3=B9 irraggiungibile, come = per me la pagina https://gist.github.com/ffmike/877447 -- dalla quale mi so= no ispirato e che ho completato per modificare anche i collate e ctype dei = template: postgres # update pg_database set datallowconn =3D TRUE where datname =3D '= template0'; postgres # \c template0 template0 # update pg_database set datistemplate =3D FALSE where datname = =3D 'template1'; template0 # drop database template1; template0 # create database template1 with template =3D template0 encoding = =3D 'UTF8' LC_COLLATE =3D 'it_IT.UTF-8' LC_CTYPE =3D 'it_IT.UTF-8'; template0 # update pg_database set datistemplate =3D TRUE where datname =3D= 'template1'; template0 # \c template1 template1 # drop database template0; template1 # create database template0 with template =3D template1 encoding = =3D 'UTF8' LC_COLLATE =3D 'it_IT.UTF-8' LC_CTYPE =3D 'it_IT.UTF-8'; template1 # drop database postgres; template1 # create database postgres with template =3D template1 encoding = =3D 'UTF8' LC_COLLATE =3D 'it_IT.UTF-8' LC_CTYPE =3D 'it_IT.UTF-8'; template1 # update pg_database set datallowconn =3D FALSE where datname =3D= 'template0'; (idem se usate altri template per sapere i formati supportati dalla vostra = macchina, ad esempio it_IT.UTF-8 digitate il comando locale, ovviamente su = linux) Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale pi= =C3=B9 di uno spot in TV. Per ogni nuovo abbonato 30 =E2=82=AC di premio pe= r te e per lui! Un amico al mese e parli e navighi sempre gratis: http://fr= eelosophy.tiscali.it/=20 ------=_Part_391_24636741.1376466328701 Content-Type: text/html;charset="UTF-8" Content-Transfer-Encoding: quoted-printable Allora,
ho fatto i seguenti passi:
1. ho modificato i template in mo= do che anche essi siano:

   Name   | Owner | Encoding | &nb= sp; Collate   |    Ctype    | Acces= s privileges
----------+-------+----------+-------------+-------------+-= ------------------
postgres  | pedro | UTF8    = ; | it_IT.UTF-8 | it_IT.UTF-8 |
mioDB     | pedro |= UTF8     | it_IT.UTF-8 | it_IT.UTF-8 |
template0 |= pedro | UTF8     | it_IT.UTF-8 | it_IT.UTF-8 |
tem= plate1 | pedro | UTF8     | it_IT.UTF-8 | it_IT.UTF-8 |=



Non mi piacciono i nomi di nazioni o lingue per del tes= to universale, ma da quanto ho capito, qualsiasi collate o Ctype/Collate ch= e finisce per UTF-8 va bene (+ dettagli nella guida in PS che metto perch= =C3=A9 pu=C3=B2 essere utile a qualcuno).

2. ho fatto un dump. Sicco= me non avevo memoria sufficiente, ho dovuto farlo compresso:
pg_dump dbname | gzip=
 > filename.gz
3. ho quindi elimi= nato mioDB e l'ho ricreato come si vede sopra, con collate e Ctype corretti=

4. quindi cerco di rimettere i dati nel DB:
gunzip -c filename.gz | psql dbname
ma il DB risulta vuoto a dispet= to della lunghezza dell'operazione e l'assenza di errori. Usare il metodo <= br>
cat filename<=
/tt>.gz | gunzip | psql dbname
non c= ambia niente. Entrambi sono su http://www.postgresql.org/docs/9.1/static/ba= ckup-dump.html
PS
= per convertire i template d=C3=B2 questa procedura, che in italiano non fac= ilmente si trova. Devo fare una forte critica a google, che nonostante aves= si fatto delle ricerche usando parole chiave simili, non mi ha portato alle= pagine con questa procedura. Credo sia a causa delle ricerche personalizza= te che fanno arrivare utenti diversi a risultati diversi, ma cos=C3=AC face= ndo oscurano una parte del web o la rendono pi=C3=B9 irraggiungibile, come = per me la pagina https://gist.github.com/ffmike/877447 -- dalla quale mi so= no ispirato e che ho completato per modificare anche i collate e ctype dei = template:

postgres # update pg_database set datallowconn =3D TRUE wh= ere datname =3D 'template0';
postgres # \c template0
template0 # upda= te pg_database set datistemplate =3D FALSE where datname =3D 'template1';template0 # drop database template1;
template0 # create database templ= ate1 with template =3D template0 encoding =3D 'UTF8' LC_COLLATE =3D 'it_IT.= UTF-8' LC_CTYPE =3D 'it_IT.UTF-8';
template0 # update pg_database set da= tistemplate =3D TRUE where datname =3D 'template1';
template0 # \c templ= ate1
template1 # drop database template0;
template1 # create database= template0 with template =3D template1 encoding =3D 'UTF8' LC_COLLATE =3D '= it_IT.UTF-8' LC_CTYPE =3D 'it_IT.UTF-8';
template1 # drop database postg= res;
template1 # create database postgres with template =3D template1 en= coding =3D 'UTF8' LC_COLLATE =3D 'it_IT.UTF-8' LC_CTYPE =3D 'it_IT.UTF-8';<= br>template1 # update pg_database set datallowconn =3D FALSE where datname = =3D 'template0';


Invita i tuoi amici e Tiscali ti premia! Il co= nsiglio di un amico vale pi=C3=B9 di uno spot in TV. Per ogni nuovo abbonat= o 30 =E2=82=AC di premio per te e per lui! Un amico al mese e parli e navig= hi sempre gratis: http://freelosophy.tiscali.it/

------=_Part_391_24636741.1376466328701--