2010-06-10 48 views
1

我開始將系統從MS SQL Server轉換爲Postgres。我已經轉換了表結構,並使用「bcp」從SQL Server中獲取數據。sql server批量複製/ postgres從infile複製

ERROR: invalid byte sequence for encoding "UTF8": 0x80 
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". 
CONTEXT: COPY cm_outgoing, line 200: "200 c:\temp\200.xml 2009-10-10 01:50:44.000 1900-01-01 00:00:00.000" 

我已經使用「sed的」擺脫了文件中的NUL(0×00)項的,我無法找到該文件中,我試圖導入的0x80的任何實例。

有什麼想法?有更容易的方法嗎?

回答

0

你的數據真的是UTF8嗎?你有沒有嘗試過在你的postgresql客戶端中設置client_encoding到Latin1之類的東西?

set client_encoding = 'latin1'; 
--do your COPY here 
+0

看起來像在Windows路徑中的麻煩。我不確定我們如何達到0x80,但加倍反斜槓。 – 2010-06-13 16:42:26

2

看起來像麻煩在windows的路徑。我不確定我們如何達到0x80,但加倍反斜槓。