Update 'Install_PostgreSQL_14_and_PostGIS_3'
parent
398becb7ea
commit
e40d3b5940
|
@ -85,30 +85,31 @@ exit psql:\
|
|||
and re-login into gn_db:\
|
||||
`postgres@geomon:~$psql -d gn_db -U postgres -p 5432`
|
||||
|
||||
create a schema 'gba' for all gn_db tabels with full authorization for the user 'gn_admin':\
|
||||
`gn_db=# CREATE SCHEMA IF NOT EXISTS gba AUTHORIZATION gn_admin;`
|
||||
change owner of schema 'public' to user 'gn_admin' for full authorization: \
|
||||
`ALTER SCHEMA public OWNER TO gn_admin;`
|
||||
|
||||
> CREATE SCHEMA
|
||||
|
||||
### Change user privileges:
|
||||
-> grant select, insert, update and delete privileges for the user 'gn_app':\
|
||||
`gn_db=# grant usage on schema gba to gn_app;`
|
||||
`gn_db=# grant usage on schema public to gn_app;`
|
||||
> GRANT
|
||||
|
||||
`gn_db=# grant select, insert, update, delete on all tables in schema gba to gn_app;`
|
||||
`gn_db=# grant select, insert, update, delete on all tables in schema public to gn_app;`
|
||||
> GRANT
|
||||
|
||||
**Default "select, insert, update, delete privileges" on tables to sos_app**\
|
||||
`gn_db=# alter default privileges for role gn_admin in schema gba grant select, insert, update, delete on tables to gn_app;`
|
||||
`gn_db=# alter default privileges for role gn_admin in schema public grant select, insert, update, delete on tables to gn_app;`
|
||||
> ALTER DEFAULT PRIVILEGES
|
||||
|
||||
**Default usage privileges on sequences to sos_app**\
|
||||
grant usage on all sequences in schema gba to sos_app:\
|
||||
`gn_db=# alter default privileges for role gn_admin in schema gba grant usage on sequences to gn_app;`
|
||||
grant usage on all sequences in schema public to sos_app:\
|
||||
`gn_db=# alter default privileges for role gn_admin in schema public grant usage on sequences to gn_app;`
|
||||
> ALTER DEFAULT PRIVILEGES
|
||||
|
||||
**Default execute privileges on function to sos_app**\
|
||||
grant execute on all functions in schema gba to sos_app:\
|
||||
`alter default privileges for role gn_admin in schema gba grant execute on functions to gn_app;`
|
||||
grant execute on all functions in schema public to sos_app:\
|
||||
`alter default privileges for role gn_admin in schema public grant execute on functions to gn_app;`
|
||||
> ALTER DEFAULT PRIVILEGES
|
||||
|
||||
### Create extensions:
|
||||
|
|
Loading…
Reference in New Issue
Block a user