用pg_dump备份失败,错误信息提示pg_dump: [archiver (db)] query failed: ERROR: schema "pgs_distribution_metadata" does not exist
[postgres@node1 backup]$ pg_dump -Fc shop > shop.dump
pg_dump: [archiver (db)] query failed: ERROR: schema "pgs_distribution_metadata" does not exist
pg_dump: [archiver (db)] query was: COPY public.chars (chr) TO stdout;
postgres=# dn
List of schemas
Name | Owner
pgs_distribution_metadata | postgres |
public | postgres |
(2 rows)
尝试删除 pgs_distribution_metadata,后再试
postgres=# drop schema pgs_distribution_metadata cascade;
ERROR: cannot drop schema pgs_distribution_metadata because extension pg_shard requires it
HINT: You can drop extension pg_shard instead.
postgres=# drop extension pg_shard cascade;
DROP EXTENSION
postgres=# dn
List of schemas
Name | Owner |
---|---|
public | postgres |
(1 row)
同事注释掉postgresql.con里关于pg_shard的相关设定,
restart后再试,用pg_dump备份依然失败
[postgres@node1 backup]$ pg_dump -Fc shop > shop.dump
pg_dump: [archiver (db)] query failed: ERROR: schema "pgs_distribution_metadata" does not exist
pg_dump: [archiver (db)] query was: COPY public.chars (chr) TO stdout;
寻求解决办法,谢谢!
德哥,谢谢你的回复。
我shop库的owner也是postgres。
[postgres@node1 backup]$ psql
psql (9.4.1)
Type "help" for help.
postgres=# set
AUTOCOMMIT = 'on'
PROMPT1 = '%/%R%# '
PROMPT2 = '%/%R%# '
PROMPT3 = '>> '
VERBOSITY = 'default'
VERSION = 'PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit'
DBNAME = 'postgres'
USER = 'postgres'
PORT = '5432'
ENCODING = 'LATIN1'
postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
contrib_regression | postgres | UTF8 | C | C | |
movies | postgres | UTF8 | C | C | |
postgres | postgres | UTF8 | C | C | |
re_bookstore | postgres | UTF8 | C | C | |
shop | postgres | UTF8 | C | C | |
supermarket | postgres | UTF8 | C | C | |
template0 | postgres | UTF8 | C | C | =c/postgres + |
postgres=CTc/postgres | |||||
template1 | postgres | UTF8 | C | C | postgres=CTc/postgres+ |
我用pg_dump备份postrges库,依然出现同样的错误。
[postgres@node1 backup]$ pg_dump -Fc postgres > postgres.dump
pg_dump: [archiver (db)] query failed: ERROR: schema "pgs_distribution_metadata" does not exist
pg_dump: [archiver (db)] query was: COPY public.customer_reviews (customer_id, review_date, review_rating, review_votes, review_helpful_votes, product_id, product_title, product_sales_rank, product_group, product_category, product_subcategory, similar_product_ids) TO stdout;
麻烦你帮助详细解释一下该问题的发生原因及解决方案,谢谢!
你备份的是shop库,所以在postgres库操作是没用的。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。