{"action":"opened","issue":{"url":"https://api.github.com/repos/craigkerstiens/postgresguide.com/issues/83","repository_url":"https://api.github.com/repos/craigkerstiens/postgresguide.com","labels_url":"https://api.github.com/repos/craigkerstiens/postgresguide.com/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/craigkerstiens/postgresguide.com/issues/83/comments","events_url":"https://api.github.com/repos/craigkerstiens/postgresguide.com/issues/83/events","html_url":"https://github.com/craigkerstiens/postgresguide.com/issues/83","id":228244228,"number":83,"title":"pg_store with example.dump failed","user":{"login":"gedennis","id":21010353,"avatar_url":"https://avatars1.githubusercontent.com/u/21010353?v=3","gravatar_id":"","url":"https://api.github.com/users/gedennis","html_url":"https://github.com/gedennis","followers_url":"https://api.github.com/users/gedennis/followers","following_url":"https://api.github.com/users/gedennis/following{/other_user}","gists_url":"https://api.github.com/users/gedennis/gists{/gist_id}","starred_url":"https://api.github.com/users/gedennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedennis/subscriptions","organizations_url":"https://api.github.com/users/gedennis/orgs","repos_url":"https://api.github.com/users/gedennis/repos","events_url":"https://api.github.com/users/gedennis/events{/privacy}","received_events_url":"https://api.github.com/users/gedennis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-12T09:57:52Z","updated_at":"2017-05-12T09:57:52Z","closed_at":null,"body":"I have installed pg with docker locally, and I can access it successfully. I have create the user **craig** ，database **pgguide**。However, when I restore the dump file as sub command, i encounter with a error。\r\n```\r\n $ pg_restore --no-owner -h localhost --dbname pgguide example.dump\r\npg_restore: [archiver (db)] Error while PROCESSING TOC:\r\npg_restore: [archiver (db)] Error from TOC entry 2251; 0 0 COMMENT EXTENSION plpgsql\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql\r\n    Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2252; 0 0 COMMENT EXTENSION hstore\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension hstore\r\n    Command was: COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 166; 1259 444692 TABLE products craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"products\" already exists\r\n    Command was: CREATE TABLE products (\r\n    id integer NOT NULL,\r\n    title character varying(255),\r\n    price numeric,\r\n    created_at timesta...\r\npg_restore: [archiver (db)] Error from TOC entry 165; 1259 444690 SEQUENCE products_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"products_id_seq\" already exists\r\n    Command was: CREATE SEQUENCE products_id_seq\r\n    START WITH 1\r\n    INCREMENT BY 1\r\n    NO MINVALUE\r\n    NO MAXVALUE\r\n    CACHE 1;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2253; 0 0 SEQUENCE OWNED BY products_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation products_id_seq\r\n    Command was: ALTER SEQUENCE products_id_seq OWNED BY products.id;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2254; 0 0 SEQUENCE SET products_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for sequence products_id_seq\r\n    Command was: SELECT pg_catalog.setval('products_id_seq', 20, true);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 168; 1259 444703 TABLE purchase_items craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"purchase_items\" already exists\r\n    Command was: CREATE TABLE purchase_items (\r\n    id integer NOT NULL,\r\n    purchase_id integer,\r\n    product_id integer,\r\n    price numeric,\r\n ...\r\npg_restore: [archiver (db)] Error from TOC entry 167; 1259 444701 SEQUENCE purchase_items_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"purchase_items_id_seq\" already exists\r\n    Command was: CREATE SEQUENCE purchase_items_id_seq\r\n    START WITH 1\r\n    INCREMENT BY 1\r\n    NO MINVALUE\r\n    NO MAXVALUE\r\n    CACHE 1;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2255; 0 0 SEQUENCE OWNED BY purchase_items_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchase_items_id_seq\r\n    Command was: ALTER SEQUENCE purchase_items_id_seq OWNED BY purchase_items.id;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2256; 0 0 SEQUENCE SET purchase_items_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for sequence purchase_items_id_seq\r\n    Command was: SELECT pg_catalog.setval('purchase_items_id_seq', 1458, true);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 162; 1259 444669 TABLE purchases craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"purchases\" already exists\r\n    Command was: CREATE TABLE purchases (\r\n    id integer NOT NULL,\r\n    created_at timestamp with time zone,\r\n    name character varying(255),\r\n...\r\npg_restore: [archiver (db)] Error from TOC entry 161; 1259 444667 SEQUENCE purchases_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"purchases_id_seq\" already exists\r\n    Command was: CREATE SEQUENCE purchases_id_seq\r\n    START WITH 1\r\n    INCREMENT BY 1\r\n    NO MINVALUE\r\n    NO MAXVALUE\r\n    CACHE 1;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2257; 0 0 SEQUENCE OWNED BY purchases_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchases_id_seq\r\n    Command was: ALTER SEQUENCE purchases_id_seq OWNED BY purchases.id;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2258; 0 0 SEQUENCE SET purchases_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for sequence purchases_id_seq\r\n    Command was: SELECT pg_catalog.setval('purchases_id_seq', 1000, true);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 164; 1259 444680 TABLE users craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"users\" already exists\r\n    Command was: CREATE TABLE users (\r\n    id integer NOT NULL,\r\n    email character varying(255),\r\n    password character varying(255),\r\n    det...\r\npg_restore: [archiver (db)] Error from TOC entry 163; 1259 444678 SEQUENCE users_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  relation \"users_id_seq\" already exists\r\n    Command was: CREATE SEQUENCE users_id_seq\r\n    START WITH 1\r\n    INCREMENT BY 1\r\n    NO MINVALUE\r\n    NO MAXVALUE\r\n    CACHE 1;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2259; 0 0 SEQUENCE OWNED BY users_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation users_id_seq\r\n    Command was: ALTER SEQUENCE users_id_seq OWNED BY users.id;\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2260; 0 0 SEQUENCE SET users_id_seq craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for sequence users_id_seq\r\n    Command was: SELECT pg_catalog.setval('users_id_seq', 50, true);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2232; 2604 444695 DEFAULT id craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation products\r\n    Command was: ALTER TABLE ONLY products ALTER COLUMN id SET DEFAULT nextval('products_id_seq'::regclass);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2233; 2604 444706 DEFAULT id craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchase_items\r\n    Command was: ALTER TABLE ONLY purchase_items ALTER COLUMN id SET DEFAULT nextval('purchase_items_id_seq'::regclass);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2230; 2604 444672 DEFAULT id craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchases\r\n    Command was: ALTER TABLE ONLY purchases ALTER COLUMN id SET DEFAULT nextval('purchases_id_seq'::regclass);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2231; 2604 444683 DEFAULT id craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation users\r\n    Command was: ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2245; 0 444692 TABLE DATA products craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for relation products\r\n    Command was: COPY products (id, title, price, created_at, deleted_at, tags) FROM stdin;\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2246; 0 444703 TABLE DATA purchase_items craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for relation purchase_items\r\n    Command was: COPY purchase_items (id, purchase_id, product_id, price, quantity, state) FROM stdin;\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2243; 0 444669 TABLE DATA purchases craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for relation purchases\r\n    Command was: COPY purchases (id, created_at, name, address, state, zipcode, user_id) FROM stdin;\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2244; 0 444680 TABLE DATA users craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  permission denied for relation users\r\n    Command was: COPY users (id, email, password, details, created_at, deleted_at) FROM stdin;\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2239; 2606 444700 CONSTRAINT products_pkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation products\r\n    Command was: ALTER TABLE ONLY products\r\n    ADD CONSTRAINT products_pkey PRIMARY KEY (id);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2235; 2606 444677 CONSTRAINT purchases_pkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchases\r\n    Command was: ALTER TABLE ONLY purchases\r\n    ADD CONSTRAINT purchases_pkey PRIMARY KEY (id);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2237; 2606 444688 CONSTRAINT users_pkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation users\r\n    Command was: ALTER TABLE ONLY users\r\n    ADD CONSTRAINT users_pkey PRIMARY KEY (id);\r\n\r\n\r\n\r\npg_restore: [archiver (db)] Error from TOC entry 2242; 2606 444715 FK CONSTRAINT purchase_items_product_id_fkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchase_items\r\n    Command was: ALTER TABLE ONLY purchase_items\r\n    ADD CONSTRAINT purchase_items_product_id_fkey FOREIGN KEY (product_id) REFERENCES produc...\r\npg_restore: [archiver (db)] Error from TOC entry 2241; 2606 444710 FK CONSTRAINT purchase_items_purchase_id_fkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchase_items\r\n    Command was: ALTER TABLE ONLY purchase_items\r\n    ADD CONSTRAINT purchase_items_purchase_id_fkey FOREIGN KEY (purchase_id) REFERENCES purc...\r\npg_restore: [archiver (db)] Error from TOC entry 2240; 2606 444720 FK CONSTRAINT purchases_user_id_fkey craig\r\npg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of relation purchases\r\n    Command was: ALTER TABLE ONLY purchases\r\n    ADD CONSTRAINT purchases_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);\r\n\r\n\r\n\r\nWARNING: errors ignored on restore: 32\r\n```\r\nIs the dump file not latest or I did with a wrong way?  beg for ur answer."}}
{"actor":{"display_login":"gedennis"}}