2013-08-17 48 views

回答

9

要在postgress表中看到其他不可見的Unicode,您需要同時使用「編碼」和「轉義」。只是爲了好玩,escape函數需要一個強制類型來輸入bytea。全部放在一起:

# CREATE TABLE xxx_test (foo text); 
# INSERT INTO xxx_test (foo) values (E'Invis\u200eble €'); 

# SELECT foo from xxx_test; 
Invis‎ble € 
# SELECT encode(foo::bytea, 'escape') FROM xxx_test; 
Invis\342\200\216ble \342\202\254 

# DROP TABLE xxx_test;