我使用DBeaver(使用pg_dump)导出了本地Postgres数据库。
如果我将数据导入生产数据库,他将无法还原音序器,当然也不会将自动增量设置为我的主键。
我认为问题在于,因为我的序列有一个所有者,该所有者在生产服务器上不存在。
这是我的本地音序器的屏幕截图:
这是我导入时遇到的错误之一(宅基地是我的本地用户)
pg_restore: creating SEQUENCE OWNED BY "public.new_customer_id_seq"
pg_restore: [archiver (db)] Error from TOC entry 4013; 0 0 SEQUENCE OWNED BY new_customer_id_seq homestead
pg_restore: [archiver (db)] could not execute query: FEHLER: Relation »public.new_customer_id_seq« does not exists
Command was: ALTER SEQUENCE public.new_customer_id_seq OWNED BY public.new_customer.id;
还有这个
pg_restore: [archiver (db)] could not execute query: FEHLER: Role »homestead« does not exists
Command was: ALTER TABLE public.new_customer OWNER TO homestead;
但是如何在本地更改序列的所有者?
我对pgAdmin有同样的问题。