I have a database my_database
, and it have some tables named my_table_1
, my_table_2
, ... , my_table_128
under schema public
. I need to grant select privileges for all tables in schema public
to user my_db_user
, so I execute SQL command below:
GRANT SELECT ON ALL TABLES IN SCHEMA public to my_db_user;
And it executed without error. But after I connect with user my_db_user
and tried to select something, it displaied permission denied. And I tried execute SQL command below with admin user:
GRANT SELECT ON TABLE public.my_table_1 TO my_db_user;
Then connect with user my_db_user
and tried to select something, it works.