pgsql 导入导出sql 命令 导入: .\pg_restore.exe -h 150.158.170.111 -p 5432 -U postgres -d electronic_filing_system -v D:\sql\full_backup.dump psql -U postgres -d electronic_filing_system -f /home/electronic_filing_system.sql 导出具体表 .\pg_restore.exe -h 150.158.170.111 -p 5432 -U postgres -d electronic_filing_system -t sys_form -v D:\sql\full_backup.dump 导出: .\pg_dump.exe -h localhost -p 5432 -U postgres -d electronic_filing_system --format=custom -f D:\sql\full_backup.dump 与版本无关的 pg_dump --inserts --encoding=UTF8 -U postgres -h 150.158.170.111 -p 5432 -d electronic-filing-release -s -c --if-exists -t payment_mx -f D:/sql/payment_mx.sql -s 只导出表结构,导出数据时可以去掉 -s 参数 修改字段 ALTER TABLE public.ynw_invoice_item ALTER COLUMN tax_rate TYPE numeric(10, 5) USING tax_rate::numeric; 修改主键为identity的主键编号开始值 ALTER TABLE archive_menu_sublist ALTER COLUMN id RESTART SET START WITH 2060;