恢复postgres转储出错:types不存在

我从一台旧的Ubuntu机器上用postgresql 8.4 wiandth postgis 1.5抛弃了一个数据库。 在新的Ubuntu 12.04上,我已经安装了Postgresql 9.1和Postgis 1.5。 (使用postgis.sql和spatial_ref_sys.sql创buildpostgis_template)。

当我在新的机器上恢复转储时,数据是build立,但我得到这样的25错误消息

... pg_restore: [archiver (db)] Error from TOC entry 711; 1255 18533 FUNCTION gidx_in(cstring) postgres pg_restore: [archiver (db)] could not execute query: ERROR: function public.gidx_in(cstring) does not exist Command was: DROP FUNCTION public.gidx_in(cstring); pg_restore: [archiver (db)] Error from TOC entry 34; 1255 17743 FUNCTION geometry_send(geometry) postgres pg_restore: [archiver (db)] could not execute query: ERROR: type "geometry" does not exist Command was: DROP FUNCTION public.geometry_send(geometry); pg_restore: [archiver (db)] Error from TOC entry 33; 1255 17742 FUNCTION geometry_recv(internal) postgres pg_restore: [archiver (db)] could not execute query: ERROR: function public.geometry_recv(internal) does not exist Command was: DROP FUNCTION public.geometry_recv(internal); pg_restore: [archiver (db)] Error from TOC entry 31; 1255 17740 FUNCTION geometry_out(geometry) postgres pg_restore: [archiver (db)] could not execute query: ERROR: type "geometry" does not exist Command was: DROP FUNCTION public.geometry_out(geometry); pg_restore: [archiver (db)] Error from TOC entry 30; 1255 17739 FUNCTION geometry_in(cstring) postgres pg_restore: [archiver (db)] could not execute query: ERROR: function public.geometry_in(cstring) does not exist Command was: DROP FUNCTION public.geometry_in(cstring); pg_restore: [archiver (db)] Error from TOC entry 709; 1255 18529 FUNCTION geography_out(geography) postgres pg_restore: [archiver (db)] could not execute query: ERROR: type "geography" does not exist Command was: DROP FUNCTION public.geography_out(geography); 

任何人都可以解释发生了什么事? 我可以忽略这些错误吗?

谢谢! 亲切的问候,

托尼

你有多个错误。 需要仔细阅读它们,然后阅读你的转储文件(find上面的错误引用的行,并确定是否发生这些错误是一个严重的问题,或者你可以忽略) – 我们不能告诉你,因为我们真的不知道你的环境中的重要。

从我在错误消息中看到的内容看起来像转储文件试图在实际加载数据之前清除旧的数据库内容( DROP函数,types和表),所以如果要恢复到没有现有数据的系统当它试图删除不存在的对象时会出错。
如果这是怎么回事,你可能不必担心错误(尽pipe你可能想在没有“清理”命令的情况下进行转储以备将来使用,所以你不会得到它们) – 请参阅pg_dump手册页信息如何做到这一点)。

现在,如果开始出现错误,创buildfunction/程序更可能是严重的,需要调查和纠正。