[highgo@yueqi ~]$ psql -p 5866 -U u_lei -d db_lei
psql (4.1.1)
PSQL: Release 4.1.1
Connected to:
HighGo Database V4.1 Enterprise Edition Release 4.1.1 - 64-bit Production
Type "help" for help.
db_lei=> create schema s_lei;
错误: 42501: 对数据库 db_lei 权限不够
db_lei=> exit
db_lei-> \q
[highgo@yueqi ~]$ psql
psql (4.1.1)
PSQL: Release 4.1.1
Connected to:
HighGo Database V4.1 Enterprise Edition Release 4.1.1 - 64-bit Production
Type "help" for help.
highgo=# \c
PSQL: Release 4.1.1
Connected to:
HighGo Database V4.1 Enterprise Edition Release 4.1.1 - 64-bit Production
You are now connected to database "highgo" as user "highgo".
highgo=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+--------+----------+------------+------------+-------------------
benchmarksql | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 |
db_lei | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 | =Tc/highgo +
| | | | | highgo=CTc/highgo+
| | | | | u_lei=c/highgo
db_zhang | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 | =Tc/highgo +
| | | | | highgo=CTc/highgo+
| | | | | u_zhang=c/highgo
highgo | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 |
template0 | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 | =c/highgo +
| | | | | highgo=CTc/highgo
template1 | highgo | UTF8 | zh_CN.utf8 | zh_CN.utf8 | =c/highgo +
| | | | | highgo=CTc/highgo
(6 rows)
highgo=# grant create on database db_lei to u_lei;
GRANT
highgo=#
结论:1.schema是每个database中都有的。
对PG数据库user和schema的理解
原创
©著作权归作者所有:来自51CTO博客作者wx5bcd90b347f01的原创作品,请联系作者获取转载授权,否则将追究法律责任
2.user是pg cluster级别的。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
pg schema
db_le
pg schema postgresql sql -
pg查看 schema Pg查看数据库
数据库的命令窗口PostgreSQL 命令窗口中,我们可以命令提示符后面输入 SQL 语句:postgres=#使用 \l 用于查看已经存在的数据库:postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype |
pg查看 schema postgresql 数据库 PostgreSQL 删除数据