--3 创建只读帐号
[postgres@pgb ~]$ psql psql (9.1.0) Type "help" for help. postgres=# create role test LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE encrypted password 'mydb_select'; CREATE ROLE |
---|
备注:上面创建帐号 test 。
--4 给帐号 test 赋权
postgres=# \c mydb mydb You are now connected to database "mydb" as user "mydb".mydb=> grant connect on database mydb to mydb_select; GRANTmydb=> grant usage on schema public to test; GRANTmydb=> grant select on all tables in schema public to test; GRANT |
---|
GRANT SELECT, UPDATE, INSERT ON ALL TABLES IN schema public TO promopureadmin;
POSTGRES重置自增id
select setval('path_expression_id_seq', 1, false)
POSTGRES杀死进程
查询进程:SELECT * FROM pg_stat_activity;