在PostgreSQL数据库中,每个表格table都有一个owner,这个owner拥有修改table里字段的个数、名称、类型等权限。这里以teachdb数据库中student表格的owner设置hello为例,进行说明,将owner:postgres --> hello。
1、创建teachdb数据库
使用Navicat连接PostgreSQL,创建一个名称为teachdb的数据库,如图(1)所示:

2、设置表格的owner
将student表格的owner,由postgres改为hello,命令如下:
## 1)使用postgres登录teachdb
psql -U postgres -d teachdb
## 2)查看owner
\d
## 3)设置student的owner为hello
alter table student owner to hello;
## 4)查看更新后的owner
\d
