其他分享
首页 > 其他分享> > postgres 初体验

postgres 初体验

作者:互联网

用命令工具 ,登录

如果是本地安装,前面几个提示,可以直接 回车,直到到提示输入密码
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
用户 postgres 的口令:
psql (13.1)

常用基本命令

thingsboard=# \d
关联列表
架构模式 | 名称 | 类型 | 拥有者
----------+------------+--------+----------
public | company | 数据表 | postgres
public | department | 数据表 | postgres
(2 行记录)

thingsboard=# \d department;
数据表 "public.department"
栏位 | 类型 | 校对规则 | 可空的 | 预设
--------+---------------+----------+----------+------
id | integer | | not null |
dept | character(50) | | not null |
emp_id | integer | | not null |
索引:
"department_pkey" PRIMARY KEY, btree (id)

thingsboard=# \c
您现在已经连接到数据库 "thingsboard",用户 "postgres".
thingsboard=# \l

标签:初体验,postgres,数据表,department,thingsboard,null,id
来源: https://www.cnblogs.com/gxhh-lzh/p/14123864.html