如何从PostgreSQL源码分析哪些操作需要超级用户权限root

41148人阅读
PostgreSQL其他(28)
Pg权限分为两部分,一部分是“系统权限”或者数据库用户的属性,可以授予role或user(两者区别在于login权限);一部分为数据库对象上的操作权限。对超级用户不做权限检查,其它走acl。对于数据库对象,开始只有所有者和超级用户可以做任何操作,其它走acl。在pg里,对acl模型做了简化,组和角色都是role,用户和角色的区别是角色没有login权限。
可以用下面的命令创建和删除角色,
CREATE ROLE name;
DROP ROLE name;
为了方便,也可以在 shell 命令上直接调用程序
和 ,这些工具对相应命令提供了封装:
createuser name
dropuser name
数据库对象上的权限有:SELECT,INSERT, UPDATE,DELETE,RULE,
REFERENCES,TRIGGER,CREATE, TEMPORARY,EXECUTE,和
USAGE等,具体见下面定义
typedefuint32AclMode;&&&&&&&&
/* a bitmask of privilege bits */
ACL_INSERT&&&&& (1&&0)&
/* forrelations */
#defineACL_SELECT&&&&&
#defineACL_UPDATE&&&&&
#defineACL_DELETE&&&&&
#defineACL_TRUNCATE&&&
#defineACL_REFERENCES&
#defineACL_TRIGGER&&&&
#defineACL_EXECUTE&&&&
(1&&7)& /* for functions */
#defineACL_USAGE&&&&&&
(1&&8)& /* for languages, namespaces, FDWs, and
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&* servers */
#defineACL_CREATE&&&&&
(1&&9)& /* for namespaces and databases */
#defineACL_CREATE_TEMP (1&&10)
/* for databases */
#defineACL_CONNECT&&&&
(1&&11) /* for databases */
#defineN_ACL_RIGHTS&&&
12&&&&& /* 1plus the last 1&&x */
#defineACL_NO_RIGHTS&&
/*Currently, SELECT ... FOR UPDATE/FOR SHARE requires UPDATE privileges */
#defineACL_SELECT_FOR_UPDATE&&
ACL_UPDATE
我们可以用特殊的名字 PUBLIC 把对象的权限赋予系统中的所有角色。 在权限声明的位置上写 ALL,表示把适用于该对象的所有权限都赋予目标角色。
beigang=#& grantall on schema csm_
beigang=# revoke all on schema csm_
每种对象的all权限定义如下:
Bitmasks defining &allrights& for each supported object type
#defineACL_ALL_RIGHTS_COLUMN&&&&&&
(ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_REFERENCES)
#defineACL_ALL_RIGHTS_RELATION
&&& (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_DELETE|ACL_TRUNCATE|ACL_REFERENCES|ACL_TRIGGER)
#defineACL_ALL_RIGHTS_SEQUENCE&&&&
(ACL_USAGE|ACL_SELECT|ACL_UPDATE)
#defineACL_ALL_RIGHTS_DATABASE&&&&
(ACL_CREATE|ACL_CREATE_TEMP|ACL_CONNECT)
ACL_ALL_RIGHTS_FDW&&&&&&&&& (ACL_USAGE)
#defineACL_ALL_RIGHTS_FOREIGN_SERVER (ACL_USAGE)
#defineACL_ALL_RIGHTS_FUNCTION&&&&
(ACL_EXECUTE)
#defineACL_ALL_RIGHTS_LANGUAGE&&&&
(ACL_USAGE)
#defineACL_ALL_RIGHTS_LARGEOBJECT&
(ACL_SELECT|ACL_UPDATE)
#defineACL_ALL_RIGHTS_NAMESPACE&&&
(ACL_USAGE|ACL_CREATE)
#defineACL_ALL_RIGHTS_TABLESPACE&&
(ACL_CREATE)
用户的属性可参见下图:
pg_roles提供访问数据库角色有关信息的接口。 它只是一个
表的公开可读部分的视图,把口令字段用空白填充了。
Table 42-39.pg_roles字段
有超级用户权限的角色
rolcreaterole
可以创建更多角色的角色
rolcreatedb
可以创建数据库的角色
rolcatupdate
可以直接更新系统表的角色。(除非这个字段为真,否则超级用户也不能干这个事情。)
rolcanlogin
可以登录的角色,也就是说,这个角色可以给予初始化会话认证的标识符。
rolpassword
不是口令(总是 ********)
rolvaliduntil
timestamptz
口令失效日期(只用于口令认证);如果没有失效期,为 NULL
运行时配置变量的会话缺省
下面实验验证
先创建一个角色xxx,再创建一个超级用户csm、普通用户csm_ca,csm用户创建一个数据库testdb,在这个数据库里创建一个schema:csm_ca,然后赋予普通用户csm_ca操作数据库testdb里schema:csm_ca里的表的权限。
Create role:
testdb=# create rol
CREATE ROLE
Create user:
testdb=# create user csm with superuserpassword 'csm';
CREATE ROLE
testdb=# create user csm_ca with password 'csm_ca';
CREATE ROLE
testdb=# \du
-[ RECORD 1]--------------------------------------
角色名称 | csm
属性&&&& | 超级用户
成员属于 | {}
-[ RECORD 2]--------------------------------------
角色名称 | csm_ca
属性&&&& |
成员属于 | {}
-[ RECORD 3 ]--------------------------------------
角色名称 | postgres
属性&&&& | 超级用户, 建立角色, 建立 DB, Replication
成员属于 | {}
-[ RECORD 4]--------------------------------------
角色名称 | xxx
属性&&&& | 超级用户, 无法登录
成员属于 | {}
testdb=# SELECT * FROM pg_
-[ RECORD 1 ]---------+---------
rolname&&&&&&&&&&&&&& | postgres
rolsuper&&&&&&&&&&&&& | t
rolinherit&&&&&&&&&&& | t
rolcreaterole&&&&&&&& | t
rolcreatedb&&&&&&&&&& | t
rolcreatedblink&&&&&& | t
rolcreatepublicdblink | t
roldroppublicdblink&& | t
rolcatupdate&&&&&&&&& | t
rolcanlogin&&&&&&&& &&| t
rolreplication&&&&&&& | t
rolconnlimit&&&&&&&&& | -1
rolpassword&&&&&&&&&& | ********
rolvaliduntil&&&&&&&& |
rolconfig&&&&&&&&&&&& |
oid&&&&&&&&&&&&&&&&&& | 10
-[ RECORD 2 ]---------+---------
rolname&&&&&&&&&&&&&& | csm
rolsuper&&&&&&&&&&&&& | t
rolinherit&&&&&&&&&&& | t
rolcreaterole&&&&&&&& | f
rolcreatedb&&&&&&&&&& | f
rolcreatedblink&&&&&& | f
rolcreatepublicdblink | f
roldroppublicdblink&& | f
rolcatupdate&&&&&&&&& | t
rolcanlogin&&&&&&&&&& | t
rolreplication&&&&&&& | f
rolconnlimit&&&&&&&&& | -1
rolpassword&&&&&&&&&& | ********
rolvaliduntil&&&&&&&& |
rolconfig&&&&&&&&&&&& |
oid&&&&&&&&&&&&&&&&&& | 24598
-[ RECORD 3 ]---------+---------
rolname&&&&&&&&&&&&&& | csm_ca
rolsuper&&&&&&&&&&&&& | f
rolinherit&&&&&&&&&&& | t
rolcreaterole&&&&&&&& | f
rolcreatedb&&&&&&&&&& | f
rolcreatedblink&&&&&& | f
rolcreatepublicdblink | f
roldroppublicdblink&& | f
rolcatupdate&&&&&&&&& | f
rolcanlogin&&&&&&&&&& | t
rolreplication&&&&&&& | f
rolconnlimit&&&&&&&&& | -1
rolpassword&&&&&&&&&& | ********
rolvaliduntil&&&&&&&& |
rolconfig&&&&&&&&&&&& |
oid&&&&&&&&&&&&&&&&&& | 24599
-[ RECORD 4 ]---------+---------
rolname&&&&&&&&&&&&&& | xxx
rolsuper&&&&&&&&&&&&& | t
rolinherit&&&&&&&&&&& | t
rolcreaterole&&&&&&&& | f
rolcreatedb&&&&&&&&&& | f
rolcreatedblink&&&&&& | f
rolcreatepublicdblink | f
roldroppublicdblink&& | f
rolcatupdate&&&&&&&&& | t
rolcanlogin&&&&&&&&&& | f
rolreplication&&&&&&& | f
rolconnlimit&&&&&&&&& | -1
rolpassword&&&&&&&&&& | ********
rolvaliduntil&&&&&&&& |
rolconfig&&&&&&&&&&&& |
oid&&&&&&&&&&&&& &&&&&| 24600
postgres=# \c beigang
You are now connected to database &beigang& as user &csm&.
Csm用户在beigang里创建schema: csm_ca
beigang=# create schema csm_
CREATE SCHEMA
验证模式csm_ca和用户csm_ca
beigang=# \dn
&& 架构模式列表
& 名称& |& 拥有者
--------+----------
&csm_ca | csm
&dbo&&& | postgres
&public | postgres
&sys&&& | postgres
(4 行记录)
beigang=# \du
&&&&&&&&&&&&&&&&&&&&&&&&&&& 角色列表
&角色名称 |&&&&&&&&&&&&&&&&&& 属性&&&&&&&&&&&&&&&&&& | 成员属于
----------+------------------------------------------+----------
&csm&&&&& | 超级用户&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& | {}
&csm_ca&& |&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& | {}
&postgres | 超级用户, 建立角色, 建立 DB, Replication | {}
&xxx&&&&& | 超级用户, 无法登录&&&&&&&&&&&&&&&&&&&&&& | {}
超级用户csm给普通用户csm_ca授予操作schema csm_ca的权限
beigang=#& grant all on schema csm_ca to csm_
beigang=# grant all on all tables in schema csm_ca to csm_
pg中组就是role,操作见以下
beigang=# grant xxx to csm_
GRANT ROLE
beigang=# revoke xxx from csm_
REVOKE ROLE
Pg documentation
src/include/nodes/parsenodes.h
src/include/utils/acl.h
-----------------
转载请著明出处,来自以下博客或mail至联系:
blog.csdn.net/beiigang
&&相关文章推荐
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:599785次
积分:6728
积分:6728
排名:第3149名
原创:135篇
转载:30篇
评论:47条
(2)(6)(14)(10)(1)(1)(14)(9)(1)(3)(1)(1)(1)(10)(10)(5)(5)(8)(8)(7)(5)(3)(7)(5)(5)(24)PgSQL · 答疑解惑 · PostgreSQL 用户组权限管理
RDS上的PG没有开放超级用户,这给很多云上的客户使用PG带来了困难。因此有必要给大家讲讲PG的用户权限管理的一些小知识,它可以很好的帮助用户顺利的从之前的 DB 管理方式过度到云上。
PG 的 superuser 拥有几乎全部的数据库权限,甚至可以直接修改系统表,潜在风险相当大;
RDS PG 使用 superuser 运维 DB,例如管理用、管理流复制、备份等,这些操作用户是不需要关心的,换句话说它应该完全的交给云服务来处理;
对于用户而言,PG 的普通用户权限是完全够用的。使用普通用户,可以管理自己在云上的数据(对表进行DDL、DML、创建修改和管理其他数据库对象)。
之前的 PG 用户习惯使用 superuser 进行日常运维,一方面 superuser 完全不用做任何的授权,使用方便;另一方面这样的操作带来了潜在的风险,容易误操作。
最近碰到了较多的用户反馈,没有了超级用户,无法使用 RDS 的普通用户,管理其他普通用户创建的对象,经常出现操作对象无权限的问题,尤其存在多用户的情况下。通常情况下:
一个普通用户只能在自己 owner 的DB下创建 schema;
DB 下的对象有一个所属的 schema,普通用户可以在 public 下创建对象(如 table),在其他 schema 下创建对象需要 schema 的 owner 是当前用户或特别的授权;
管理一个数据库对象,需要是超级用户、或对象的 owner 是当前用户(在用户组权限之外)。
很多用户,使用了很多个 user 在 public 模式下创建了多张表,但是单个用户却没有权限同时管理他们, 更没有权限切换他们的 owner 到一个统一的用户下做统一处理,十分恼火。
在这里,我们提供一种通用的方法,可以使用 PG 的用户组和继承特性,做到使用一个普通用户管理多个其他用户。
使用 RDS 的根账号创建一个用于管理数据库和用户的管理员账号,他具有创建用户和创建 DB 的权限
postgres=# create user admin createdb createrole login password 'pgsql';
CREATE ROLE
postgres=# \du
List of roles
Attributes
| Member of
-------------+------------------------------------------------+-----------
| Create role, Create DB
| Superuser
使用这个 admin 登陆 postgres,创建用于存放数据的DB
postgres=& cre
CREATE DATABASE
创建子账户subuser1 subuser2,并把他们的权限给admin
dbadmin=& create user subuser1 ;
CREATE ROLE
dbadmin=& create user subuser2 ;
CREATE ROLE
dbadmin=& grant subuser1
GRANT ROLE
dbadmin=& grant subuser2
GRANT ROLE
我们看到 admin 用户组管理了下列2个用户,也就是admin 拥有 subuser1,subuser2 的所有权限
dbadmin=& \du
List of roles
Attributes
-------------+------------------------------------------------+---------------------
| Create role, Create DB
| {subuser1,subuser2}
使用 subuser1 或 subuser2 登陆数据库 dbadmin,public schema上创建 owner 是自己的表对象和其他对象。分别用3个用户创建3张表a b c用作测试,另外也可以使用 admin 用户创建分别属于 subuser1 和 subuser2 的 schema ,再创建 table
dbadmin=& \d
List of relations
--------+------------+-------+----------
public | t_admin
| table | admin
public | t_subuser1 | table | subuser1
public | t_subuser2 | table | subuser2
使用 admin 用户,可以对这3张表做管理,例如:
current_user
--------------
dbadmin=& drop table t_admin,t_subuser1,t_subuser2;
DROP TABLE
但是 subuser1 无法删除 t_admin 和 t_subuser2,同理 subuser2 也无法删除 t_admin 和 t_subuser1
current_user
--------------
dbadmin=& drop table t_
must be owner of relation t_admin
dbadmin=& drop table t_subuser1;
DROP TABLE
dbadmin=& drop table t_subuser2;
must be owner of relation t_subuser2
同理,可以使用 admin 用户,重置这3张表的 owner 到3个用户中的一个,而使用 subuser1 和 subuser2 则没有权限操作,例如:
current_user
--------------
dbadmin=& alter table t_admin owner to subuser1;
ALTER TABLE
dbadmin=& alter table t_subuser2 owner to subuser1;
ALTER TABLE
dbadmin=& alter table t_subuser1 owner to subuser2;
ALTER TABLE
current_user
--------------
dbadmin=& \d
List of relations
--------+------------+-------+----------
public | t_admin
| table | subuser1
public | t_subuser1 | table | subuser2
public | t_subuser2 | table | subuser1
dbadmin=& alter table t_
must be member of role "admin"
dbadmin=& alter table t_subuser1 owner to subuser1;
must be owner of relation t_subuser1
最后,提一个完成上述功能的假设,admin 用户默认具有 INHERIT 权限,INHERIT 权限决定一个角色是否“继承”它所在组的角色的权限。一个带有 INHERIT 属性的角色可以自动使用已经赋与它直接或间接所在组的任何权限。没有 INHERIT,其它角色的成员关系只赋与该角色 SET ROLE 成其它角色的能力;其它角色的权限只是在这么做了之后才能获得。如果没有声明,缺省是 INHERIT。通过系统表, pg_roles 可以获得该用户的权限信息
dbadmin=& select rolname,rolinherit from pg_
| rolinherit
-------------+------------
使用 PG 用户组可以做到使用一个 PG 用户组管理所在组内的所有其他普通用户和他们的对象。RDS 用户设置一个用户组,既可以管理多个用户的对象,又可以实现一定程度上的权限隔离,同时权限又不会过大,推荐在云上使用该方式管理自己的数据库。
如果要实现更加细粒度的权限控制,则需要使用 grant 和 revoke 语句,请参考官方
本作品采用进行许可。博客访问: 107378
博文数量: 99
注册时间:
认证徽章:
呱呱牛语:东方欲晓,踏遍青山人未老,莫道君行早.
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: NoSQL
一、 创建一个不带有权限的基本用户& &pg_client
[postgres@v_22 bin]$ ./createuser --interactive pg_
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
[postgres@v_22 bin]$ ./psql
psql (9.3.6)
Type "help" for help.
postgres=# \du
& & & & & & & & & & & & & & & & &List of roles
& & Role name & & | & & & & & & & & & Attributes & & & & & & & & & | Member of&
------------------+------------------------------------------------+-----------
&ctsi_lbs & & & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ctsi_lbs_loc & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ctsi_lbs_monitor | & & & & & & & & & & & & & & & & & & & & & & & &| {}
&ctsi_lbs_sms & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ispyufabu & & & &| Superuser, No inheritance & & & & & & & & & & &| {}
&newisp & & & & & | Superuser, No inheritance & & & & & & & & & & &| {}
&pg_client & & & &| & & & & & & & & & & & & & & & & & & & & & & & &| {}
&postgres & & & & | Superuser, Create role, Create DB, Replication | {}
二、登录账号并赋予pg_client查询表的权限 ,但是在list of roles attributes 并未出现select信息
[postgres@v_22 bin]$ ./psql&
psql (9.3.6)
Type "help" for help.
postgres=# \l
& & & & & & & & & & & & & & & & & & & & & &List of databases
& & & & Name & & & & | & & &Owner & & & | Encoding | & Collate & | & &Ctype & &| & Access privileges &&
---------------------+------------------+----------+-------------+-------------+-----------------------
&ctsi_lbs_db & & & & | ctsi_lbs & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&ctsi_lbs_geo_db & & | ctsi_lbs & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&ctsi_lbs_gis_db & & | ctsi_lbs & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&ctsi_lbs_loc_db & & | ctsi_lbs_loc & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&ctsi_lbs_monitor_db | ctsi_lbs_monitor | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&ctsi_lbs_sms_db & & | ctsi_lbs_sms & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&isptest & & & & & & | ispyufabu & & & &| UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&newisp & & & & & & &| newisp & & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&postgres & & & & & &| postgres & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 |&
&template0 & & & & & | postgres & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres & & & & &+
& & & & & & & & & & &| & & & & & & & & &| & & & & &| & & & & & & | & & & & & & | postgres=CTc/postgres
&template1 & & & & & | postgres & & & & | UTF8 & & | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres & & & & &+
& & & & & & & & & & &| & & & & & & & & &| & & & & &| & & & & & & | & & & & & & | postgres=CTc/postgres
[postgres@v_22 bin]$ ./psql -U ctsi_lbs -d ctsi_lbs_db
ctsi_lbs_db=# &grant select &on all tables in schema public to pg_
ctsi_lbs_db=& \du
& & & & & & & & & & & & & & & & &List of roles
& & Role name & & | & & & & & & & & & Attributes & & & & & & & & & | Member of&
------------------+------------------------------------------------+-----------
&ctsi_lbs & & & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ctsi_lbs_loc & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ctsi_lbs_monitor | & & & & & & & & & & & & & & & & & & & & & & & &| {}
&ctsi_lbs_sms & & | Superuser, No inheritance & & & & & & & & & & &| {}
&ispyufabu & & & &| Superuser, No inheritance & & & & & & & & & & &| {}
&newisp & & & & & | Superuser, No inheritance & & & & & & & & & & &| {}
&pg_client & & & &| & & & & & & & & & & & & & & & & & & & & & & & &| {}
&postgres & & & & | Superuser, Create role, Create DB, Replication | {}
三、登录pg_client账号,验证权限是否成功
[postgres@v_22 bin]$ ./psql -U pg_client -d ctsi_lbs_db&
psql (9.3.6)
Type "help" for help.
ctsi_lbs_db=& \dt
& & & & & & & &List of relations
&Schema | & & & &Name & & & &| Type &| &Owner &&
--------+--------------------+-------+----------
&public | auto_loc_mdn & & & | table | postgres
&public | auto_location & & &| table | postgres
&public | ent_billing_file & | table | postgres
&public | last_location & & &| table | postgres
&public | loc_db_config & & &| table | postgres
&public | loc_status & & & & | table | postgres
&public | location_navigator | table | postgres
ctsi_lbs_db=& select * from loc_
&loc_code | & & & & & & & & & & & & & definition & & & & & & & & & & & & & | scene | remark&
----------+----------------------------------------------------------------+-------+--------
& & & & 0 | 成功 & & & & & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 1 | 基础定位平台异常 & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 2 | 基础定位平台繁忙或超出定位请求上限 & & & & & & & & & & & & & & | & & & |&
& & & & 3 | 核心网忙而无法处理请求 & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 4 | SPID鉴权失败(SPID不存在或IP地址不存在或状态错误) & & & & & & | & & & |&
& & & & 5 | SPID密码错误 & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 6 | 请求包中号码超过限制 & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 7 | 请求包格式有问题 & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 8 | 请求包的语法不对 & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & & 9 | 定位时超出定位请求上限 & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &10 | 取消周期定位消息时reqid不存在 & & & & & & & & & & & & & & & & &| & & & |&
& & & &11 | 未知的MSID & & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &12 | 回叫号码未知 & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &13 | 无效的请求信息 & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &14 | 返回的是手机的信道信息 & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &15 | 未检测到信号 & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &16 | PDE超时 & & & & & & & & & & & & & & & & & & & & & & & & & & & &| & & & |&
& & & &17 | 位置未确定 & & & & & & & & & & & & & & & & & & & & & & & & & & | & & & |&
& & & &18 | 返回的是TDMA MAHO信息 & & & & & & & & & & & & & & & & & & & & &| & & & |&
& & & &19 | TDMA MAHO信息不可得达 & & & & & & & & & & & & & & & & & & & & &| & & & |&
ctsi_lbs_db=& update loc_status set loc_code = 300 where loc_code= 0;
ERROR: &permission denied for relation loc_status
ctsi_lbs_db=& insert into loc_status &values ( 300,'hello',null ,null);
ERROR: &permission denied for relation loc_status
ctsi_lbs_db=&&
四、验证pg_client 用户属性
ctsi_lbs_db=& SELECT * from pg_
& & &rolname & & &| rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcatupdate | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolconfig | &oid &
------------------+----------+------------+---------------+-------------+--------------+-------------+----------------+--------------+-------------+---------------+-----------+-------
&postgres & & & & | t & & & &| t & & & & &| t & & & & & & | t & & & & & | t & & & & & &| t & & & & & | t & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | & &10
&ctsi_lbs & & & & | t & & & &| f & & & & &| f & & & & & & | f & & & & & | t & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 16389
&ctsi_lbs_loc & & | t & & & &| f & & & & &| f & & & & & & | f & & & & & | t & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 16390
&ispyufabu & & & &| t & & & &| f & & & & &| f & & & & & & | f & & & & & | t & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 16428
&ctsi_lbs_sms & & | t & & & &| f & & & & &| f & & & & & & | f & & & & & | t & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 17220
&ctsi_lbs_monitor | f & & & &| t & & & & &| f & & & & & & | f & & & & & | f & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 36755
&newisp & & & & & | t & & & &| f & & & & &| f & & & & & & | f & & & & & | t & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 36944
&pg_client & & & &| f & & & &| t & & & & &| f & & & & & & | f & & & & & | f & & & & & &| t & & & & & | f & & & & & & &| & & & & & -1 | ******** & &| & & & & & & & | & & & & & | 38510
ctsi_lbs_db=&&
阅读(1759) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。}

我要回帖

更多关于 超级用户权限 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信