Det ligner en fejl, måske i regclass
eller noget relateret til det:
# 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)
(Mit system er OSX Lion med alt utf8, hvis det har betydning.)
For at løse problemet kan du caste det til ::regclass
som det er gjort ovenfor (den der fandt tabellen). Bemærk, at casting til ::regclass
vil dog give en fejl, hvis tabellen ikke eksisterer, så kode omkring det i overensstemmelse hermed.
Per Craigs anmodning:
# 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)
Og ifølge 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)