I have a multi-tenant PostgreSQL db on a Ruby on Rails app, and when I try to access to tables on some schemas on Postico, I get the following error:
Failed to load table schema.
Query failed
PostgreSQL said: permission denied for schema coaching
I tried to run: GRANT USAGE ON SCHEMA "lacerba-api" TO "postico7" but I get ERROR: permission denied for schema lacerba-api
Of course my user have writing permission on the db.
Any idea how to solve it?
My guess is that your user doesn't have permission to read tables in the coaching schema. You can try granting your user permission to read tables in that schema:
GRANT SELECT ON SCHEMA coaching TO postico7
Related
I am working on a secure view and share in snowflake.
So, I need to grant reference_usage of each DB to share before granting view permission to share.
My view has like 7-8 databases in its statement(due to joining) and so I need to grant all these DB reference usage permission to share.
One way of doing this, I can run the below command for each database.
grant reference_usage on database db_XYZ to share share_ABC;
Is there any command in snowflake to grant permission to all databases at once?
No, the REFERENCE_USAGE privilege must be granted individually to each database.
https://docs.snowflake.com/en/sql-reference/sql/grant-privilege-share.html#usage-notes
Of course, you can write a script to generate and execute grant commands for all databases.
I have an Oracle user user1 and a schema schema1. I want to give permissions insert, update and delete to this user on this schema.
I only find in the documentation that I can give permissions on this schema tables.
Is there a way to give permission on whole schema?
You can add roles and privileges to the user or use the grant command.
https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljgrant.html
You can also use the GRANT ALL PRIVILEGES TO {USERNAME} command.
I am using dbForge to create a dynamic database in cPanel using CodeIgnter, and I'm getting this error:
A Database Error Occurred
Error Number: 1044
Access denied for user '************'#'localhost' to database 'informsa_inform_sap_10000'
CREATE DATABASE `informsa_inform_sap_10000` CHARACTER SET utf8 COLLATE utf8_general_ci
What does it mean?
you need to give privileges to the database user you created;
cpanel / database users can go and edit privileges.
or create a new database user and define all privileges
I'm trying to dump my pg db but got these errors please suggest
pg_dump: [archiver (db)] query failed: ERROR: permission denied for relation abouts
pg_dump: [archiver (db)] query was: LOCK TABLE public.abouts IN ACCESS SHARE MODE
The user which you're performing your pg_dump as doesn't have permissions on the public schema.
Add permissions if allowed:
GRANT USAGE ON SCHEMA public TO <user>;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO <user>;
This can be a common error, when using a ROLE (user) that could not open the objects to dump them.
Like said before, you can grant to the specific schema that you want to dump, or even use a ROLE with SUPERUSER attribute.
Note that when you are dealing with some cloud database providers, like AWS/RDS you will not receive a user with the SUPERUSER attribute, so you will need to manage to make sure that the one used to dump will have all access needed.
https://www.postgresql.org/docs/current/static/sql-grant.html will show how give GRANT to many objects on your database, but also remember that when restoring you will need to create the database first. Only if you are using pg_dumpall that is not necessary, but you also need to dump the ROLES.
Change the permission to the user: login as sudo user by using following cmd
sudo -u postgres psql
Alter the user role
alter role <user-name> superuser;
How can I grant permission to specific users in Hive?
When I try with different users and set the permission with the GRANT statement, then these users were able to change the permission on create, update and any kind of operation on the objects(database, tables etc).
So how can I configure Hive such that only the selected user is able to grant permission?