docker 、postgres 数据库常用命令大全,持续更新

使用postgres 数据库,经常会忘记命令。今天抽时间整理一份常用命令列表,附带实践

使用docker 执行命令,导出数据库

css 复制代码
docker exec -i postgres-container pd_dump -U postgres -d zxapp > /opt/zxapp.sql

或者进入交互式界面:

css 复制代码
 docker exec -it postgres-container bash

执行导出命令:

css 复制代码
pg_dump -U postgres -d zxapp > database.sqlls

将文件 从容器中复制到主机中

css 复制代码
# docker cp postgres-container:/zxapp.sql /opt

![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/77566fa6951444519cc608295ac0e6a4.png)
相关推荐
2401_832131952 小时前
Python单元测试(unittest)实战指南
jvm·数据库·python
打工的小王2 小时前
redis(四)搭建哨兵模式:一主二从三哨兵
数据库·redis·缓存
Anarkh_Lee3 小时前
【小白也能实现智能问数智能体】使用开源的universal-db-mcp在coze中实现问数 AskDB智能体
数据库·人工智能·ai·开源·ai编程
橘子133 小时前
MySQL用户管理(十三)
数据库·mysql
Dxy12393102163 小时前
MySQL如何加唯一索引
android·数据库·mysql
我真的是大笨蛋3 小时前
深度解析InnoDB如何保障Buffer与磁盘数据一致性
java·数据库·sql·mysql·性能优化
怣503 小时前
MySQL数据检索入门:从零开始学SELECT查询
数据库·mysql
shengli7223 小时前
机器学习与人工智能
jvm·数据库·python
啦啦啦小石头3 小时前
Docker 换源
docker
2301_765703143 小时前
Python迭代器(Iterator)揭秘:for循环背后的故事
jvm·数据库·python