Re: encoding problem - Mailing list pgsql-admin

From Fouad Fezzi
Subject Re: encoding problem
Date
Msg-id JGEKKDOKMOJAIPCDEDPDKEAFCGAA.Fouad.Fezzi@iup.univ-avignon.fr
Whole thread Raw
In response to encoding problem  ("Alexey A. Britchko" <beholder@roaddep.ru>)
List pgsql-admin

-----Message d'origine-----
De : pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]De la part de Alexey A.
Britchko
Envoye : mardi 25 mars 2003 07:08
A : pgsql-admin@postgresql.org
Objet : [ADMIN] encoding problem


Hi there

How did upgrade from pgsql 6.x to pgsql 7.x:
1. Dumped database
2. ./configure --enable-locale --enable-multibyte=WIN; make; make
install;
3. Killed postmaster daemon
3. rm -rf /usr/local/pgsql/data; mkdir /usr/local/pgsql/data; chown
postgres /usr/local/pgsql/data;
4. /usr/local/pgsql/bin/initdb -E WIN -D /usr/local/pgsql/data
5. Started postmaster daemon
6. Restored database from dbdump file.

What i've got now:

$ /usr/local/pgsql/bin/psql -l
        List of databases
   Name    |  Owner   | Encoding
-----------+----------+-----------
 dcl       | raven    | SQL_ASCII
 dragons   | raven    | SQL_ASCII
 postgres  | postgres | SQL_ASCII
 template0 | postgres | WIN
 template1 | postgres | WIN
 test      | postgres | SQL_ASCII
(6 rows)

The default encoding for 4 of databases is SQL_ASCII. Well, that's OK.
The database encoding is shure to be described in the dump file. And
it seems to be restored correctly.

But now when I make selections, I get data in the SQL_ASCII (a think
so) encoding instead of WIN (WIN1251). Before PostgreSQL upgrade
everything were working correctly.

The questions:
1. What happens with the database encoding when I do pg_dumpall ?
It seem to me that upgrade postrgesql database get data in SQL_ASCII
2. How can I permanently switch database encoding without
database re-initialization? If I can't, how can I do that with DB
re-initialization?
Here what i do when automatic upgrade dont't work
a_ createdb -E select-your-favorite-encoding database
b_ psql -d database -f dump.data

Hope that help

--
Best regards,
 Alexey                          mailto:beholder@roaddep.ru


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


pgsql-admin by date:

Previous
From: "Tamir Halperin"
Date:
Subject: Zope and ZPsycopgDA almost working...
Next
From: Daniel Rubio
Date:
Subject: Can't connect to my postgresql