话不多说直接整
1、登录服务器
su - postgres
2、psql (端口不是5432的需要 psql -p port)
3、\c testdb (进入数据库)
4、set schema ‘schema’(切换模式)
5、\o /tmp/1.txt (编写语句需要存储的文件名及属性)
6、select * from tb_base_company; (查询该表所有数据并写到/tmp/1.txt中)
pg数据库使用命令行查询数据并写入到文件中
最新推荐文章于 2023-04-19 17:24:09 发布