January 2019
Beginner
556 pages
14h 19m
English
PostgreSQL provides the DO statement, which can be used to execute anonymous code blocks. The DO statement reduces the need to create shell scripts for administration purposes. However, note that all PostgreSQL functions are transactional; so, if you would like to create indexes, for example, shell scripting is a better alternative, or procedures, which are introduced in PostgreSQL 11. For more details, take a look at Chapter 7, Server-Side Programming with PL/pgSQL. In the car portal schema, let's assume that we would like to have another user who can only perform select statements. You can create a role, as follows:
CREATE user select_only;
Now, you need to grant select permission on each table for the newly ...
Read now
Unlock full access