Sembra un bug, forse in regclass
o qualcosa ad esso correlato:
# create table pinkƒpink1 (id serial);
NOTICE: CREATE TABLE will create implicit sequence "pink?pink1_id_seq" for serial column "pink?pink1.id"
CREATE TABLE
# select 'pinkƒpink1'::name;
name
------------
pinkƒpink1
(1 row)
# select 'pinkƒpink1'::regclass;
regclass
-------------
"pinkpink1"
(1 row)
# select relname from pg_class where oid = 'pinkƒpink1'::regclass;
relname
-----------
pinkpink1
# select relname from pg_class where relname = 'pinkƒpink1'::name;
relname
---------
(0 rows)
# select relname from pg_class where relname = 'pinkpink1';
relname
---------
(0 rows)
(Il mio sistema è OSX Lion con tutto utf8, nel caso sia importante.)
Per la soluzione alternativa, puoi trasmetterlo a ::regclass
come fatto sopra (quello che ha trovato la tabella). Nota che trasmettere a ::regclass
produrrà un errore se la tabella non esiste, quindi codificalo di conseguenza.
Per richiesta di Craig:
# SELECT current_setting('server_encoding') AS server_encoding, current_setting('client_encoding') AS client_encoding, version();
server_encoding | client_encoding | version
-----------------+-----------------+-----------------------------------------------------------------------------------------------------------------------------------
UTF8 | UTF8 | PostgreSQL 9.2.4 on x86_64-apple-darwin11.4.2, compiled by Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn), 64-bit
(1 row)
E per Erwin:
# SELECT name, setting FROM pg_settings WHERE name IN ('lc_collate','lc_ctype','client_encoding','server_encoding');
name | setting
-----------------+-------------
client_encoding | UTF8
lc_collate | en_US.UTF-8
lc_ctype | en_US.UTF-8
server_encoding | UTF8
(4 rows)