From: | Narayanan V <vnarayanan(dot)email(at)gmail(dot)com> |
---|---|
To: | hlinnaka(at)iki(dot)fi |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, avaidyanathaswamy(at)corelogic(dot)com, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Postgres restore issue |
Date: | 2018-10-27 19:30:57 |
Message-ID: | CAJP1NzPrG64caASjKHS4DRHLNvGCx5QrnnqUKEXEv38ydmpu5g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Anand,
I was unsuccessful in trying to reproduce this with a database and pg_dump
from 8.3.7 and a pg_restore of 8.4.22.
------------------------------------------------------------------------------------------------------
I do get the following error during the restore on an empty database,
however,
I think we can safely ignore this.
pg_restore: dropping TABLE employees
pg_restore: [archiver (db)] Error from TOC entry 1465; 1259 16391 TABLE
employees kannan
pg_restore: [archiver (db)] could not execute query: ERROR: table
"employees" does not exist
Command was: DROP TABLE public.employees;
As evident the above error happens because the employees table does not
exist in an empty database.
------------------------------------------------------------------------------------------------------
I think I would follow Heikki's comments and check for errors during the
schema restore first.
------------------------------------------------------------------------------------------------------
Although I am not sure it would make much of a difference I would suggest
you try the --create (-C)
option. Please note that this option tries to delete and re-create the
database itself hence you will
need to supply some other database to the -d option.
Thank you,
Narayanan
On Sat, Oct 27, 2018 at 3:30 PM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> On 25 October 2018 20:27:07 WEST, "Vaidyanathaswamy, Anandsaikrishnan" <
> avaidyanathaswamy(at)corelogic(dot)com> wrote:
> >We have postgres running in 8.4.22, We have back up from 8.3.7
> >When I try to restore, All the tables are not restored, almost 60% of
> >the tables not exist, Failed with the following errors.
> >
> >Any help on this much appreciated.
> >
> >I am using the below command for pg_restore
> >
> >nohup pg_restore -c -U postgres -d gpl_maps
> >~/gcs/PostgreSQL/gpl_maps_devgm01.bkup &
> >
> >
> >pg_restore: [archiver (db)] Error from TOC entry 7580; 0 49537695 TABLE
> >DATA bldg_footprints gpl-layer-loader
> >pg_restore: [archiver (db)] could not execute query: ERROR: relation
> >"bldg_footprints" does not exist
> >Command was: COPY bldg_footprints (gid, id, inbld_fid, bld_status,
>
> These errors are coming from restoring the data. Were there any errors
> before these, from the CREATE TABLE commands? You could try using the -s
> option, to restore just the schema first, and check if all the tables exist
> after that. You could also run it without the username and database
> options, to create a human-readable SQL file. That might give a better clue
> on what's going on.
>
> - Heikki
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Gustafsson | 2018-10-27 21:01:06 | Conflicting option checking in pg_restore |
Previous Message | Alban Hertroys | 2018-10-27 19:02:12 | Re: Ltree: set of allowed charcters is limited to [A-Za-z0-9_]. Could the dash "-" be included? |