pgsql 备份

pg_dump  -U xxx -h 127.0.0.1 -p 5432 -d  database   -t schema.table   --inserts  -f  table.sql

 

mkdir  /home/tt
chown postgres.postgres /home/tt

su - postgres
## 切换到数据库
\c database
COPY (SELECT * FROM schema.table WHERE 字段='bus_firm_rank') TO '/home/tt/output_file33.csv' WITH CSV HEADER;

 

posted @ 2024-07-31 09:32  滴滴滴  阅读(27)  评论(0)    收藏  举报