Postgres 덤프 복원 시 오류 발생: 유형이 존재하지 않습니다.

Postgres 덤프 복원 시 오류 발생: 유형이 존재하지 않습니다.

나는 postgresql 8.4와 postgis 1.5를 사용하는 오래된 Ubuntu 시스템에서 데이터베이스를 덤프했습니다. 새로운 우분투 12.04에서는 Postgis 1.5와 함께 Postgresql 9.1도 설치했습니다. (postgis.sql 및 Spatial_ref_sys.sql을 사용하여 postgis_template을 생성했습니다).

새 컴퓨터에서 덤프를 복원하면 데이터가 빌드되지만 다음과 같은 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);

무슨 일인지 설명해 줄 수 있는 사람 있나요? 그리고 이러한 오류를 무시할 수 있나요?

감사해요! 감사합니다.

토니

답변1

오류가 여러 개 있습니다.주의 깊게 읽은 다음 덤프 파일을 읽어야 합니다(위 오류에서 참조된 줄을 찾아 이러한 오류가 발생하는 위치가 심각한 문제인지 아니면 무시할 수 있는 것인지 확인).우리우리는 귀하의 환경에서 무엇이 중요한지 모르기 때문에 이에 대해 말할 수 없습니다.

오류 메시지에서 볼 수 있듯이 덤프 파일은 실제로 데이터를 로드하기 전에 이전 데이터베이스 내용(함수, 유형 및 테이블)을 정리하려고 시도하는 것으로 보입니다. DROP따라서 기존 데이터 없이 시스템으로 복원하는 경우 존재하지 않는 개체를 삭제하려고 하면 오류가 발생합니다.
만약 그런 일이 일어나고 있다면 아마도 오류에 대해 걱정할 필요가 없을 것입니다. (나중에 사용하기 위해 "정리" 명령 없이 덤프를 만들어 오류가 발생하지 않도록 할 수도 있습니다.pg_dump매뉴얼 페이지이를 수행하는 방법에 대한 정보).

이제 CREATING 함수/프로시저에서 오류가 발생하기 시작하면 이는 심각할 가능성이 높으며 조사 및 수정이 필요합니다.

관련 정보