首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >失败(退出代码: 1)。从.tar文件在pgAdmin4 PostgreSQL10.5中运行还原DB时

失败(退出代码: 1)。从.tar文件在pgAdmin4 PostgreSQL10.5中运行还原DB时
EN

Database Administration用户
提问于 2018-08-11 00:27:26
回答 1查看 52.6K关注 0票数 4

我正在学习SQL课程的简介,但是我无法加载我的第一个数据库。我有一个文件dvdrental.tar,我在Restore选项下创建了一个新的数据库dvdrental >右击> Restore > Select >Select>选取"Data“,然后我得到下面的错误。

我在Mac上,如果这有帮助的话,pgAmin实例将在Chrome中加载。我已经尝试删除和重新添加数据库两次,但仍然得到相同的错误。我还尝试重新安装pgAdmin和完全重新安装postgresql,包括删除用户帐户。我只是尝试在Windows环境中的新安装上执行此操作,并且得到了完全相同的错误。

从那以后,我已经完全重新启动了电脑好几次。我还刚刚验证了其他tar文件和sql文件不起作用。

这是一个完整的错误,我不知道这意味着什么,因为我对SQL非常陌生,我只是设置它:

代码语言:javascript
复制
/Library/PostgreSQL/10/bin/pg_restore --host "localhost" --port "5432" --username "postgres" --no-password --dbname "dvdrental" --section=data --verbose "/Users/chasehippen/Downloads/Postgresql/dvdrental.tar"

    pg_restore: connecting to database for restore
    pg_restore: implied data-only restore
    pg_restore: processing data for table "public.actor"
    pg_restore: [archiver (db)] Error while PROCESSING TOC:
    pg_restore: [archiver (db)] Error from TOC entry 2610; 0 16430 TABLE DATA actor postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "actor" does not exist
        Command was: COPY actor (actor_id, first_name, last_name, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET actor_actor_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2643; 0 0 SEQUENCE SET actor_actor_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "actor_actor_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('actor_actor_id_seq', 200, true);
                                     ^
        Command was: SELECT pg_catalog.setval('actor_actor_id_seq', 200, true);
    pg_restore: processing data for table "public.address"
    pg_restore: [archiver (db)] Error from TOC entry 2618; 0 16471 TABLE DATA address postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "address" does not exist
        Command was: COPY address (address_id, address, address2, district, city_id, postal_code, phone, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET address_address_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2644; 0 0 SEQUENCE SET address_address_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "address_address_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('address_address_id_seq', 605, true...
                                     ^
        Command was: SELECT pg_catalog.setval('address_address_id_seq', 605, true);
    pg_restore: processing data for table "public.category"
    pg_restore: [archiver (db)] Error from TOC entry 2612; 0 16437 TABLE DATA category postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "category" does not exist
        Command was: COPY category (category_id, name, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET category_category_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2645; 0 0 SEQUENCE SET category_category_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "category_category_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('category_category_id_seq', 16, tru...
                                     ^
        Command was: SELECT pg_catalog.setval('category_category_id_seq', 16, true);
    pg_restore: processing data for table "public.city"
    pg_restore: [archiver (db)] Error from TOC entry 2620; 0 16478 TABLE DATA city postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "city" does not exist
        Command was: COPY city (city_id, city, country_id, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET city_city_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2646; 0 0 SEQUENCE SET city_city_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "city_city_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('city_city_id_seq', 600, true);
                                     ^
        Command was: SELECT pg_catalog.setval('city_city_id_seq', 600, true);
    pg_restore: processing data for table "public.country"
    pg_restore: [archiver (db)] Error from TOC entry 2622; 0 16485 TABLE DATA country postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "country" does not exist
        Command was: COPY country (country_id, country, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET country_country_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2647; 0 0 SEQUENCE SET country_country_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "country_country_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('country_country_id_seq', 109, true...
                                     ^
        Command was: SELECT pg_catalog.setval('country_country_id_seq', 109, true);
    pg_restore: processing data for table "public.customer"
    pg_restore: [archiver (db)] Error from TOC entry 2608; 0 16419 TABLE DATA customer postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "customer" does not exist
        Command was: COPY customer (customer_id, store_id, first_name, last_name, email, address_id, activebool, create_date, last_update, active) FROM stdin;
    pg_restore: executing SEQUENCE SET customer_customer_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2648; 0 0 SEQUENCE SET customer_customer_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "customer_customer_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('customer_customer_id_seq', 599, tr...
                                     ^
        Command was: SELECT pg_catalog.setval('customer_customer_id_seq', 599, true);
    pg_restore: processing data for table "public.film"
    pg_restore: [archiver (db)] Error from TOC entry 2614; 0 16444 TABLE DATA film postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "film" does not exist
        Command was: COPY film (film_id, title, description, release_year, language_id, rental_duration, rental_rate, length, replacement_cost, rating, last_update, special_features, fulltext) FROM stdin;
    pg_restore: processing data for table "public.film_actor"
    pg_restore: [archiver (db)] Error from TOC entry 2615; 0 16456 TABLE DATA film_actor postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "film_actor" does not exist
        Command was: COPY film_actor (actor_id, film_id, last_update) FROM stdin;
    pg_restore: processing data for table "public.film_category"
    pg_restore: [archiver (db)] Error from TOC entry 2616; 0 16460 TABLE DATA film_category postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "film_category" does not exist
        Command was: COPY film_category (film_id, category_id, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET film_film_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2649; 0 0 SEQUENCE SET film_film_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "film_film_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('film_film_id_seq', 1000, true);
                                     ^
        Command was: SELECT pg_catalog.setval('film_film_id_seq', 1000, true);
    pg_restore: processing data for table "public.inventory"
    pg_restore: [archiver (db)] Error from TOC entry 2624; 0 16502 TABLE DATA inventory postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "inventory" does not exist
        Command was: COPY inventory (inventory_id, film_id, store_id, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET inventory_inventory_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2650; 0 0 SEQUENCE SET inventory_inventory_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "inventory_inventory_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('inventory_inventory_id_seq', 4581,...
                                     ^
        Command was: SELECT pg_catalog.setval('inventory_inventory_id_seq', 4581, true);
    pg_restore: processing data for table "public.language"
    pg_restore: [archiver (db)] Error from TOC entry 2626; 0 16509 TABLE DATA language postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "language" does not exist
        Command was: COPY language (language_id, name, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET language_language_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2651; 0 0 SEQUENCE SET language_language_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "language_language_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('language_language_id_seq', 6, true...
                                     ^
        Command was: SELECT pg_catalog.setval('language_language_id_seq', 6, true);
    pg_restore: processing data for table "public.payment"
    pg_restore: [archiver (db)] Error from TOC entry 2628; 0 16521 TABLE DATA payment postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "payment" does not exist
        Command was: COPY payment (payment_id, customer_id, staff_id, rental_id, amount, payment_date) FROM stdin;
    pg_restore: executing SEQUENCE SET payment_payment_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2652; 0 0 SEQUENCE SET payment_payment_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "payment_payment_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('payment_payment_id_seq', 32098, tr...
                                     ^
        Command was: SELECT pg_catalog.setval('payment_payment_id_seq', 32098, true);
    pg_restore: processing data for table "public.rental"
    pg_restore: [archiver (db)] Error from TOC entry 2630; 0 16527 TABLE DATA rental postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "rental" does not exist
        Command was: COPY rental (rental_id, rental_date, inventory_id, customer_id, return_date, staff_id, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET rental_rental_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2653; 0 0 SEQUENCE SET rental_rental_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "rental_rental_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('rental_rental_id_seq', 16049, true...
                                     ^
        Command was: SELECT pg_catalog.setval('rental_rental_id_seq', 16049, true);
    pg_restore: processing data for table "public.staff"
    pg_restore: [archiver (db)] Error from TOC entry 2632; 0 16539 TABLE DATA staff postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "staff" does not exist
        Command was: COPY staff (staff_id, first_name, last_name, address_id, email, store_id, active, username, password, last_update, picture) FROM stdin;
    pg_restore: executing SEQUENCE SET staff_staff_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2654; 0 0 SEQUENCE SET staff_staff_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "staff_staff_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('staff_staff_id_seq', 2, true);
                                     ^
        Command was: SELECT pg_catalog.setval('staff_staff_id_seq', 2, true);
    pg_restore: processing data for table "public.store"
    pg_restore: [archiver (db)] Error from TOC entry 2634; 0 16550 TABLE DATA store postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "store" does not exist
        Command was: COPY store (store_id, manager_staff_id, address_id, last_update) FROM stdin;
    pg_restore: executing SEQUENCE SET store_store_id_seq
    pg_restore: [archiver (db)] Error from TOC entry 2655; 0 0 SEQUENCE SET store_store_id_seq postgres
    pg_restore: [archiver (db)] could not execute query: ERROR:  relation "store_store_id_seq" does not exist
    LINE 1: SELECT pg_catalog.setval('store_store_id_seq', 2, true);
                                     ^
        Command was: SELECT pg_catalog.setval('store_store_id_seq', 2, true);
    WARNING: errors ignored on restore: 28
EN

回答 1

Database Administration用户

回答已采纳

发布于 2018-08-11 04:28:14

通过取消检查数据选项来解决

票数 2
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/214640

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档