Working with tables

After taking care of bind addresses, network authentication, users, databases, and schemas, you have finally made it to the table level. The following snippet shows which permissions can be set for a table:

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE               | REFERENCES | TRIGGER }     [, ...] | ALL [ PRIVILEGES ] }     ON { [ TABLE ] table_name [, ...]          | ALL TABLES IN SCHEMA schema_name [, ...] }     TO role_specification [, ...] [ WITH GRANT OPTION ] 

Let me explain those permissions one by one:

  • SELECT: Allows you to read a table.
  • INSERT: Allows you to add rows to the table (this also includes copy and so on—it is not only about the INSERT clause). Note that if you are allowed to insert, you are not automatically allowed ...

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.