linux环境导入导出postgres数据库表结构和表数据

linux环境导入导出postgres数据库表结构和表数据
注:操作语句暂时只在linux环境下使用验证

linux环境导出postgre数据库表结构和表数据sql命令语句:
./pg_dump -U 数据库名--column-inserts 数据库名> ~/**.sql

linux环境导出postgres某张表的数据结构及数据命令语句:
./pg_dump --dbname=my_db_name --host=my_host_ip_addr --username=my_username --no-password --data-only --table=my_tables
 --inserts --column-inserts --encoding=UTF8 --disable-dollar-quoting --file=data_only_insert_sql.backup


linux导入postgres数据库sql命令语句:
./psql -U postgres -W (密码) -d 数据库名 -f ***.sql

猜你喜欢

转载自blog.csdn.net/u010786396/article/details/75406603