Обсуждение: problem name database

Поиск
Список
Период
Сортировка

problem name database

От
frank_lupo
Дата:
Hi all,

I have create database èèèè not "èèèè".
When I click on dabatabase èèèè in tree pgadmin3 show error: database "____"
does not exist

The version database:
"PostgreSQL 8.0.0beta2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.2.3 (mingw special 20030504-1)"

This is log file on pgadmin3:
--------------------------------------------------------------------
2004-10-13 17:08:46 QUERY  : Void query (localhost:5432): CREATE DATABASE
"èèèè" WITH ENCODING='UNICODE';

2004-10-13 17:08:46 QUERY  : Set query (localhost:5432): SELECT db.oid,
datname, spcname, datallowconn, datconfig, datacl,
pg_encoding_to_char(encoding) AS serverencoding, pg_get_userbyid(datdba) AS
datowner,has_database_privilege(db.oid, 'CREATE') as cancreate FROM pg_database db LEFT OUTER JOIN pg_tablespace ta ON
db.dattablespace=ta.OIDWHEREdatname='èèèè'ORDER BY datname
 
2004-10-13 17:08:46 INFO   : Creating pgSet object
2004-10-13 17:08:46 INFO   : Creating a pgDatabase object
2004-10-13 17:08:46 INFO   : Destroying pgSet object
2004-10-13 17:08:46 INFO   : Destroying a ctlSQLBox
2004-10-13 17:09:01 INFO   : Displaying properties for Database èèèè
2004-10-13 17:09:01 STATUS : Scaricamento dei dettagli di Database...
2004-10-13 17:09:01 INFO   : Creating pgConn object
2004-10-13 17:09:01 INFO   : Server name: localhost (resolved to: 127.0.0.1)
2004-10-13 17:09:01 INFO   : Opening connection with connection string:
hostaddr='127.0.0.1' dbname='èèèè' user='postgres' password='campana'
port=5432
2004-10-13 17:09:01 ERROR  : FATAL:  database "____" does not exist

2004-10-13 17:09:03 INFO   : Destroying pgConn object
2004-10-13 17:09:03 STATUS : Scaricamento dei dettagli di Database... (1,81
sec)
--------------------------------------------------------------------

Thanks Frank Lupo --Email.it, the professional e-mail, gratis per te: http://www.email.it/fSponsor:Con LINEAR
Assicurazionipuoi risparmiare fino al 40% sulla tua polizza
 
RCAuto senza rinunciare alla qualità e all’assistenza del gruppo UNIPOL.Clicca qui:
http://adv.email.it/cgi-bin/foclick.cgi?mid=2715&d=20041013




Re: problem name database

От
Andreas Pflug
Дата:
frank_lupo wrote:
> Hi all,
> 
> I have create database èèèè not "èèèè".
> When I click on dabatabase èèèè in tree pgadmin3 show error: database "____"
> does not exist

Uuu, this was a really bad one.
The name of the database as displayed depends on the encoding used when 
the database was created, and the database used when retrieving the 
database information. Unfortunately, we can't know this at connect time, 
so we have to guess.

In your case, you obviously created the database over a Unicode 
connection, so it's stored as "èèèè". If you do SELECT * from 
pg_database on a Unicode connection again, you'll get "èèèè", a 
SQL_ASCII connection (usually template1) you see that encoded string.

While connecting, we only tried without Unicode conversion. I've added a 
second try now.

Additionally, the name may be even unreadable. This can happen if you 
create the database using SQL_ASCII (even if the DB itself is UNICODE). 
In that case, it's impossible to retrieve the pg_database row, because 
its content is illegal for unicode.

cvs patch committed, new snapshot to come.

Regards,
Andreas