🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
#### **介绍** PostgreSQL是一个功能强大的开源对象关系数据库系统,经过30多年的积极开发,在可靠性,功能健壮性和性能方面赢得了良好的声誉。 #### **命令行** - 命令行文档 <https://devdocs.io/postgresql~14/app-psql> - 快速连接 ```bash psql -h localhost -p 5432 -U postgres -d dbName ``` ```bash psql -h localhost -p 5432 -U postgres -d dbName --no-password ``` - 帮助文档 `\help` - 查看所有数据库 `\l` - 切换数据库 `\c db_name` - 查看所有表和序列 `\d` - 查看所有表 `\dt` - 查看表结构 `\d table_name` or `\d+ table_name` - 展开表格 `\x` - 退出psql `\q` #### **速查清单** ```sql SELECT to_char(now(),'yyyy-MM-dd HH24:MI:ss'); -- 格式化当前时间(2022-07-15 13:17:36) ```