For example, you can grant the user john
on person
table with GRANT statement as shown below:
GRANT ALL PRIVILEGES ON TABLE person TO john;
Or, you can grant the user john
on all tables in public
schema with GRANT
statement as shown below:
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO john;
Or, you can alter person
table's owner to the user john
on person
table with ALTER TABLE statement as shown below:
ALTER TABLE person OWNER TO john;
*Memos:
Be careful, even if you grant the user john
on public
schema with GRANT
statement as shown below:
GRANT ALL PRIVILEGES ON SCHEMA public TO john;
Or, even if you grant the user john
on apple
database with GRANT
statement as shown below:
GRANT ALL PRIVILEGES ON DATABASE apple TO john;
Or, even if you alter public
schema's owner to the user john
with ALTER SCHEMA statement as shown below:
ALTER SCHEMA public OWNER TO john;
Or, even if you alter apple
database's owner to the user john
with ALTER DATABASE statement as shown below:
ALTER DATABASE apple OWNER TO john;
Then, you cannot solve the error as shown below:
apple=> SELECT * FROM person;
ERROR: permission denied for table person