pg_restore WARNING: errors ignored on restore: 62

13,778

It looks like the dump you were given is not a complete backup. It only has the data, not the object definitions. That is, it was created by pg_dump using -a, --data-only, or --section=data.

Unless you already know what the object definitions are from some other source (e.g., an existing database server with the same schema definitions, or a dump file generated with pg_dump -s), you will have a hard time loading this data.

Share:
13,778
Prometheus
Author by

Prometheus

Software Engineer

Updated on June 04, 2022

Comments

  • Prometheus
    Prometheus over 1 year

    I was given a database file , i don't know the userid who dumped it or it's privileges .

    I use postgresql 9.6.7-1 with pg_admin4(v3.0) , OS: windows 10

    1. First, i created a database in pgadmin with same name as the given file.

    2. I used the restore option to restore the file but after some seconds

    i got type of messages like :

    pg_restore: executing SEQUENCE SET xxxx
    pg_restore: [archiver (db)] Error from TOC entry 4309; 0 0 SEQUENCE SET xxxx postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.xxxx" does not exist
    LINE 1: SELECT pg_catalog.setval('public.xxxx', 1, false);
                                 ^
    Command was: SELECT pg_catalog.setval('public.xxxx', 1, false);
    

    and below all, the warning :

    "WARNING: errors ignored on restore: 62"

    comparing with other's answers i dont even get a single bit of data restored.

    I have tried also with

    pg_restore
    

    command but i get the same result .

    • jjanes
      jjanes over 5 years
      What are the 62 errors that were ignored?
    • Prometheus
      Prometheus over 5 years
      i added the type of errors as an edit to my question
    • wildplasser
      wildplasser over 5 years
      Maybe 'xxxx' exists, but in a different schema ? In the script, find out how/if xxxx is created.
    • Prometheus
      Prometheus over 5 years
      As i see the first half of these warnings have similar output but with the command "COPY" public.xxxx (column1,column2,...) FROM stdin; instead of "SELECT". Nothing about "create" so far . When u mean in a different schema , u mean different database ? .
    • wildplasser
      wildplasser over 5 years
      No,when I say schema, I mean schema. And: the select setval('xxxx', 1234); is normally added at the end of the load-script to set the sequence values to the max occurring number in the corresponding table-column.
    • Prometheus
      Prometheus over 5 years
      In conclusion , the warning issue is due to another file that has already created the corresponding tables ?
  • Prometheus
    Prometheus over 5 years
    You were actually right , i request about the definitions and i was given the same file with the necessary sql scripts and worked fine after the restore .