2009-12-30 87 views
1

我有一个Postgresql转储文件,我试图恢复。我得到了关于无效数据的错误。什么是“”。在postgresql转储文件?

ERROR: invalid input syntax for integer: "."

,当我检查的文件,有数据是这样的:

469215 2009-10-10 18:16:47.041377 0 1 
471217 2009-10-10 18:25:12.536352 0 1 
473224 2009-10-17 09:46:43.041604 0 1 
473228 2009-10-22 10:58:40.194244 0 1 
. 

,所以我想知道这是什么“”做? 我检查了一些其他工作转储,他们用“。”结束了他们的数据行。我猜这是正确的语法!

请告诉我什么是正确的语法,它有什么作用? 谢谢

回答

1

看来,它标志着一个COPY声明

年底从the documentation

End of data can be represented by a single line containing just backslash-period (\.). 
An end-of-data marker is not necessary when reading from a file, since the end of file 
serves perfectly well; it is needed only when copying data to or from client 
applications using pre-3.0 client protocol. 
+0

有没有什么办法来解决呢?有点像设置它忽略它?导致转储文件几乎是1200万行,并且搜索所有复制语句并将其结尾替换为“\”是一种痛苦。 ! – kevoroid 2009-12-30 08:17:19

+0

不知道我的头顶上有一个。但是,使用“sed”等实用程序来轻松更改它应该非常容易... – 2009-12-30 08:26:53

+0

在您编辑文件之前,您可能想先试着弄清楚它是如何发生的 - pg_dump将始终生成正确的终止符......(这是继续使用“自定义”转储格式的另一个原因) – 2009-12-30 10:23:59

相关问题