命令行
安装与启动
-
ubuntu 安装psql客户端
- sudo apt install postgresql-client-common
- sudo apt install postgresql-client
-
设置本地登陆不需要密码
- 修改配置文件 : /var/lib/postgresql/data/pg_hba.conf
- host all all all md5: 需要密码,local用 trust不需要密码
命令行
- psql :默认方式连接数据库
- 可以通过修改环境变量配置默认参数 : https://blog.csdn.net/pg_hgdb/article/details/78646517
- psql -h localhost -p 5432 -d rules_engine -U postgres : 自定义登陆
- \l, \c, \td, \q
- 查询语句加;
- https://blog.csdn.net/guoxilen/article/details/41497575
数据类型
- integer/bigint
- varchar(32)/text
- date/time/timestamp
- boolean
- double precision
- xml