admin管理员组

文章数量:1568432

pg

  1. pg_dump 备份多张表到同一个文件
PGPASSWORD='password' pg_dump -t 'thr_*' -t ellll -d dbName -U userName > /tmp/db_dump.sql

上面命令将所有以thr开头的表以及ellll表备份到sql文件
2. pg_dump备份多张表到不同文件

for table in public.haha public.test; do PGPASSWORD='haha' pg_dump -t $table -U username -d postgres --data-only --inserts > /tmp/$table.sql; done;

本文标签: pg