Questions tagged [sql-grant]

GRANT is a standard SQL command that authorizes a set of users to perform a set of operations on an object.

The basic structure of the REVOKE statement is:

GRANT <permissions-list> ON <object> TO <user-or-role-list>
    [WITH GRANT OPTION];

There are various options in standard SQL and most SQL DBMS provide their own extensions to what is specified by the standard.

711 questions
5
votes
3 answers

#1142 - INSERT command denied to user ___ for table ___

Apparently this is usually to do with size, but I only have one table with six columns. The only thing that has changed recently is that today I installed a forum but I've removed it again and the problem persists. I am entering the SQL manually in…
Sebastian
  • 3,548
  • 18
  • 60
  • 95
5
votes
2 answers

Postgres unable to create db after granting privs to role

I'm sure I'm missing something simple, but I've created the following: postgres=# \du List of roles Role name | Attributes | Member…
wadesworld
  • 13,535
  • 14
  • 60
  • 93
5
votes
0 answers

getting nextval for identity column

In my postgreSQL DB applications, I sometimes need to retrieve the next value of a sequence BEFORE running an insert. I used to make this by giving a “usage” privilege on such sequences to my users and using the “nextval” function. I recently begun…
Jacopo Russo
  • 103
  • 1
  • 4
5
votes
1 answer

Is there a way to copy or clone grants between tables in Redshift?

Due to the append-only nature of Redshift, we often need to consolidate tables to remove duplicate records and surface the most recent version of a record. To prepare for this process, the base table is renamed and a copy of it is made. A script…
tromik
  • 97
  • 3
  • 8
5
votes
0 answers

Grant privileges on all future tables, independently of their owner

I read the following question before: Grant privileges on future tables in PostgreSQL?. But if I run the following query while logged in as rbourgeon (which is a superuser): ALTER DEFAULT PRIVILEGES GRANT ALL ON TABLES IN SCHEMA myschema TO…
R. Bourgeon
  • 923
  • 1
  • 9
  • 25
5
votes
1 answer

Reshift grants verification HAS_TABLE_PRIVILEGE fails

I'm fighting with Redshit grants with groups, schemas, default privileges. When I try to check is everything is correct using the HAS_TABLE_PRIVILEGE select tablename, HAS_TABLE_PRIVILEGE('analyst', tablename, 'select') as select, …
mathieu
  • 2,330
  • 2
  • 24
  • 44
5
votes
2 answers

How to Grant REFERENCES permission to all tables

I have to grant REFERENCES permission to a login say sql_login. I can give grant REFERENCES permission to individual table like GRANT REFERENCES ON Mytable TO sql_login Is there any way to grant REFERENCES permission to my login to all my tables…
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
5
votes
4 answers

Execute Immediate fails even with CREATE table grant

I have a problem where I am creating a table using the execute immediate command in the stored procedure. However I get the error of "insufficient privileges". I checked other threads and made sure that the user has "CREATE TABLE" privilege granted…
Sameervb
  • 381
  • 3
  • 5
  • 15
5
votes
1 answer

Error: ORA-00955: name is already used by an existing object in Oracle Function

I have function which i am trying to compile and getting an error as Error: ORA-00955: name is already used by an existing object. I am really not aware of this error and try to search for this issue but did not find any solution. I dont know is…
Andrew
  • 3,632
  • 24
  • 64
  • 113
5
votes
2 answers

Why is 'identified by' mandatory in some grant commands?

I don't understand this. I have a database, my_database, and a table, tablename. I have a user, ken who has read only access to the database. This user is already set up with a password, and people use this username remotely. I want to give them…
coding_hero
  • 1,759
  • 3
  • 19
  • 34
5
votes
2 answers

managing user privileges in sqlalchemy

I have an sqlalchemy script that creates and uses many engine instances representing many user connections. All the engines are configured to point to the same postgres database. I have one engine, oSuperEngine that can do super stuff. I have…
Sheena
  • 15,590
  • 14
  • 75
  • 113
5
votes
3 answers

Mysql drop user with grants for multiple hosts

I added a user to my mysql-db with grants to access from several hosts, like: GRANT ALL PRIVILEGES ON `db`.* TO 'dbuser'@'host1'; GRANT ALL PRIVILEGES ON `db`.* TO 'dbuser'@'host2'; GRANT ALL PRIVILEGES ON `db`.* TO 'dbuser'@'host3'; GRANT ALL…
Werner
  • 1,695
  • 3
  • 21
  • 42
5
votes
3 answers

SQL Error: ORA-01039: insufficient privileges on underlying objects of the view

I am trying to get explain plan for a view using below query explain plan for select * from SCHEMA1.VIEW1; But i'm getting Error report - SQL Error: ORA-01039: insufficient privileges on underlying objects of the view 01039. 00000 - …
upog
  • 4,965
  • 8
  • 42
  • 81
5
votes
2 answers

PostgreSQL - Securing DB and hide structure

I am deploying a database in postgreSQL and I created a user that just will be able to execute certain functions. I revoked all privileges from the user i just created and granted connect privileges executing: REVOKE ALL PRIVILEGES ON DATABASE…
5
votes
3 answers

Can wildcards be used on tablenames for a GRANT in MySQL

Is it possible in MySQL to do a GRANT to a user on a set of tables within a database, e.g. to allow CREATE AND DROP ing of some table names but not others? Neither of these seem to work: GRANT SELECT ON `testdb`.`%_testing` TO …
fooquency
  • 1,575
  • 3
  • 16
  • 29