zoukankan      html  css  js  c++  java
  • postgresql-只读账号授权

    1.. 只读账号授权

    # 超级用户登录数据库
    create user ro_user password 'readonly';
    
    # 设置Postgres数据库为只读的transaction
    alter user ro_user set default_transaction_read_only=on;
    
    # 赋予用户权限,查看public模式下所有表:(新建表也会有只读权限)
    grant usage on schema public to ro_user;
    alter default privileges in schema public grant select on tables to ro_user;
    
    # 赋予用户连接数据库权限
    grant connect on database zhong to ro_user;
    # 切换到指定数据库
    c zhong
    # 赋予用户表、序列查看权限
    grant usage on schema public to ro_user;
    grant select on all sequences in schema public to ro_user;
    grant select on all tables in schema public to ro_user;
    ————————————————
    https://blog.csdn.net/weixin_38623994/article/details/106651022
    用一个例子来演示会更加清晰
  • 相关阅读:
    fork子进程
    多输入使用多线程
    多输入select
    多输入之轮询
    开启telnet
    slickedit编译调试linux应用程序
    电子书框架
    通用Makefile
    STDIN_FILENO和stdin
    libiconv交叉编译提示arm-none-linux-gnueabi-gcc
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/15129525.html
Copyright © 2011-2022 走看看