Settings
|
Sign in
|
Sign up
Bar
Post
Home
>
Bar PostgreSQL
>
View post
>
View floor comments
Reply the post
|
View all
The author has
2
posts.
postgresql允许指定用户访问某个schema的所有表的方法
Floor 4
巨大八爪鱼
7/16/24 8:58
允许用户访问schema本身(没有这个权限也不能访问schema里面的表):
GRANT USAGE ON SCHEMA 名称 TO 用户名;
如果某些表有serial自增字段,为了保证数据插入成功,还需给这些自增字段添加usage权限:
ALTER DEFAULT PRIVILEGES IN SCHEMA 名称 GRANT USAGE ON SEQUENCES TO 用户名;
巨大八爪鱼
7/16/24 17:09
给已有的表添加权限:
GRANT USAGE ON ALL SEQUENCES IN SCHEMA 名称 TO 用户名;
Content converter:
No conversion
Mainland
Taiwan
Hong Kong
Singapore
Reply the post
Content:
User:
You are currently anonymous.
Captcha:
Unclear? Try another one.