Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unfortunately there is no shortcut here, you have to revoke access for the whole table and then grant a SELECT privilege on each column except sensitive ones
-- revoke select access on encrypted_password and reset_password_token
BEGIN;
REVOKE SELECT ON admin_users FROM blazer;
GRANT SELECT (
email, reset_password_sent_at, remember_created_at, admin, deactivated_at, name, created_at, updated_at
) ON users TO blazer;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment