sql server批量复制/postgres从infile复制
我正在开始将系统从 MS SQL Server 转换为 Postgres。我转换了表结构,并使用“bcp”从 SQL Server 中获取数据。
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 (0x00) 条目,但在我尝试导入的文件中找不到任何 0x80 的实例。
有什么想法吗?有更简单的方法吗?
I'm starting a conversion of a system from MS SQL Server to Postgres. I have the table structures converted, and I use "bcp" to get the data out of SQL Server.
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"
I've already used "sed" to get rid of the NUL (0x00) entries in the file, and I can't find any instances of 0x80 in the file that I'm trying to import.
Any thoughts? Is there an easier way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来问题出在 windows 路径上。我不知道我们是如何到达 0x80 的,但是加倍反斜杠是有效的。
looks like the trouble was in the windows paths. I'm not sure how we got to 0x80, but doubling the backslashes worked.
你的数据真的是UTF8吗?您是否尝试过将 postgresql 客户端中的 client_encoding 设置为类似 Latin1 的值?
Is your data really UTF8? Have you tried setting the client_encoding in your postgresql client to something like Latin1 ?