我最近一直在玩 PostgreSQL,并且无法理解如何备份和恢复单个表。
我使用 pgadmin3 备份数据库中的单个表,以便将其复制到不同的服务器。当我尝试对文件执行 pg_restore 时,我收到错误消息,指出该序列不存在:
pg_restore: [archiver (db)] could not execute query: ERROR: relation "businesses_id_seq" does not exist
Command was:
CREATE TABLE businesses (
id integer DEFAULT nextval('businesses_id_seq'::regclass) NOT NULL,
name character varyin...
看起来转储文件不包括我的自动递增列的序列。我如何让它包含它?