A user can be given access to only some table columns.
Granting user access to specific columns
Getting ready
We will continue the example in the previous recipe, so we assume that there is already a schema called someschema and a role called somerole with USAGE privileges on it. We create a new table on which we will grant column-level privileges:
CREATE TABLE someschema.sometable2(col1 int, col2 text);
How to do it...
We want to grant somerole the ability to view existing data and insert new data; we also want to give the ability to amend existing data, limited to column...