In order to perform more data manipulation on PostgREST, we will have to employ user roles with all privileges granted on the ATM locations table:Â
- First, we will execute the following query using pgAdmin to create a new role:Â
create role atm_user nologin;
grant atm_user to dba;
grant usage on schema public to atm_user;
grant all on public."ATM locations" to atm_user;
grant usage, select on sequence public."ATM locations_ID_seq" to atm_user;
On execution of the preceding script, the result will be as shown in Figure 6.6:
Figure 6.6 – Adding a trusted user
- Next, we will set a password and provide it to PostgREST. You can use the following statements to generate a random password or you can think out a nice password as well; this password must be at least 32 characters long:
[root@ip-172-31-95-213 postgrest]# export LC_CTYPE=C
[root@ip-172-31-95-213 postgrest]# < /dev/urandom tr -dc A-Za-z0-9 | head -c32...