目录
1. 登录远程数据库
$ psql -h pinpoint.c3iy4men5.us-east-1.rds.amazonaws.com -U postgres -d pinpoint
// 退出postgres
\q
2. 数据库内的基本操作
// 删除数据库
=> drop database pinpoint;
// 删除有active connections的数据库
// https://www.postgresqltutorial.com/postgresql-drop-database/
// 创建数据库
=> create database pinpoint;
// 切换数据库
=> \c db_name
// 列出所有数据库
=> \l
// 列出当前数据库的所有schema
=> select schema_name from information_schema.schemata;
schema_name
-----------------------
information_schema
pg_catalog
pg_toast_temp_1
pg_temp_1
Tmp
public
SurveyForm
(7 rows)
// 列出当前数据库的“默认Schema中的表”、“所有表”、“某个Schema中的表”
=> \dt
=> \dt *.*
=> \dt "SurveyForm".*
// 查看数据库最大连接数
=> SHOW max_connections;
max_connections
-----------------
193
(