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
2
votes
1 answer

Grant select on views which use functions

I'm using postgresql 8.4 and am having a bit of a problem granting select privileges on a view from a database onwed by a different user when the view uses any of the databases functions. As the new user, when I try to run, for example select *…
rhyek
  • 1,790
  • 1
  • 19
  • 23
2
votes
3 answers

Oracle grant alter sequence

I have a grant alter sequence to a user. But I have to specify the schema name to alter the sequence otherwise it comes back with error sequence does not exist. Is it possible to do the grant in a way so I don't have to specify the schema name? I…
Eqbal
  • 4,722
  • 12
  • 38
  • 47
2
votes
1 answer

Which Role has which tables access in Snowflake

Could you please help me query, which can tell me which role has which tables access. E.g. Role Sales has access to t1, t2 and Role Analyst has access to t2. Thank you
2
votes
1 answer

Cannot grant CHANGE TRACKING permission at database level

We have change tracking enabled on our SQL Server. The tables which are enabled for change tracking span multiple schemas. We can successfully execute the following to grant VIEW CHANGE TRACKING on the schema class, but we would like to grant this…
Geekn
  • 2,650
  • 5
  • 40
  • 80
2
votes
2 answers

SQL Server stored procedure that grants itself EXECUTE permission

Tried searching for this but was not able to find anything. I have a handful of stored procedures in a production database where the developer has, at the very end, added a GRANT EXECUTE ON [ProcName] to [USER1] AS [dbo] My spidy sense tells me…
2
votes
2 answers

Postgres: Grant access to future tables to various users

There are several threads already on this topic. Yet I'm unable to get it done and keep getting "permission denied" errors. I must be doing something very wrong. My goal: on my postgres-database "mydatabase" I would like to have a large group of…
xof
  • 23
  • 4
2
votes
2 answers

Redshift : New table but Group members can't query

In Redshift I have a data_reader db group defined like this CREATE GROUP data_reader; GRANT USAGE ON SCHEMA reports TO GROUP data_reader; GRANT SELECT ON ALL TABLES IN SCHEMA reports TO GROUP data_reader; And I've noticed that whenever I create a…
2
votes
1 answer

how to grant references in oracle sql 12.2.0.1.0?

I'm trying to grant user1 permission to create (and alter) tables in other schemas. So far i've been able to create "simple" tables. But when it come to create tables with foreign keys got error I have oracle database 12c with 2 users/schemas.…
Alexander
  • 177
  • 2
  • 9
2
votes
1 answer

How to grant user access to additional tablespaces in Oracle?

I want to know How to grant user access to additional tablespaces in Oracle? , because I have created two additional tablespaces, one for data and the other for indexes, like this discussion said: Tablespaces in Oracle I’m doing it for performance.
andrestoga
  • 619
  • 3
  • 9
  • 19
2
votes
1 answer

Grant Execute Function permission to another user

I have a database function fn_relation_isModerator, only user api has access to this function. Now I want another user to have this permission (while keeping the previous permission as well). I checked routine name and user by following…
Shaharyar
  • 12,254
  • 4
  • 46
  • 66
2
votes
3 answers

how to select a Oracle schema-specific view from another schema

Suppose I'm logged in as USERA, I want to access all the user_* views of the USERB schema, such as user_tables, user_tab_columns. How can I do this? Thanks
Martin08
  • 20,990
  • 22
  • 84
  • 93
2
votes
1 answer

PL/SQL: Access view of different user in Stored Procedure

Good afternoon, I have 2 users in an ORACLE database, USER1 and USER2. USER2 has a view VIEW1, and i want a procedure in USER1 to access VIEW1 through a cursor, like this: create or replace procedure PROCEDURE1 is CURSOR C_CURSOR …
miduarte
  • 83
  • 1
  • 8
2
votes
1 answer

PostgreSQL - ALTER DEFAULT PRIVILEDGES....SELECT ON TABLES... in all schemas

Is it possible to alter default priviledges on PostgreSQL role, such that role has SELECT on any table in any schema (existing or created in future) I have 3 roles (app_r is member of app_rw which is member of app_rwc) and I am trying this: ALTER…
zam6ak
  • 7,229
  • 11
  • 46
  • 84
2
votes
1 answer

Which permission need to grant to access sys.dba_systems

I am working on the application which works on Oracle. For some kind of logic I need to get the list of tables from the given db user with the specified schema. In my case, I have a user which have granted access of the given schema. So when my code…
Tej Kiran
  • 2,218
  • 5
  • 21
  • 42
2
votes
2 answers

Revoke execute privileges on insertion functions in PostgreSQL

I have database with role viewer: CREATE ROLE viewer WITH NOSUPERUSER NOCREATEDB NOCREATEROLE; and also database schema called i (as for interface). There are insert functions in schema i, i.e.: SELECT * FROM i.insert_machine(1,2,3); inserts new…
Michal Špondr
  • 1,337
  • 2
  • 21
  • 44