A user needs to have access to a table in order to perform any action on it.
Make sure that you have appropriate roles defined, and that privileges are revoked from the PUBLIC
role.
Grant access to the schema containing the table, as follows:
GRANT USAGE ON someschema TO somerole; GRANT SELECT, INSERT, UPDATE, DELETE ON someschema.sometable TO somerole; GRANT somerole TO someuser, otheruser;
This sequence of commands first grants full access to all objects in that schema to a role, gives viewing (SELECT
) and modifying (INSERT
, UPDATE
, and DELETE
) rights on that table to the role, and then grants membership in that role to two database users.