FirebirdSQL logo

Privileges on Tables and Views

For tables and views, unlike other metadata objects, it is possible to grant several privileges at once.

List of Privileges on Tables
SELECT

Permits the user or object to SELECT data from the table or view

INSERT

Permits the user or object to INSERT rows into the table or view

DELETE

Permits the user or object to DELETE rows from the table or view

UPDATE

Permits the user or object to UPDATE rows in the table or view, optionally restricted to specific columns

REFERENCES

Permits the user or object to reference the table via a foreign key, optionally restricted to the specified columns.If the primary or unique key referenced by the foreign key of the other table is composite then all columns of the key must be specified.

ALL [PRIVILEGES]

Combines SELECT, INSERT, UPDATE, DELETE and REFERENCES privileges in a single package

Examples of GRANT <privilege> on Tables

  1. SELECT and INSERT privileges to the user ALEX:

    GRANT SELECT, INSERT ON TABLE SALES
      TO USER ALEX;
  2. The SELECT privilege to the MANAGER, ENGINEER roles and to the user IVAN:

    GRANT SELECT ON TABLE CUSTOMER
      TO ROLE MANAGER, ROLE ENGINEER, USER IVAN;
  3. All privileges to the ADMINISTRATOR role, together with the authority to grant the same privileges to others:

    GRANT ALL ON TABLE CUSTOMER
      TO ROLE ADMINISTRATOR
      WITH GRANT OPTION;
  4. The SELECT and REFERENCES privileges on the NAME column to all users and objects:

    GRANT SELECT, REFERENCES (NAME) ON TABLE COUNTRY
    TO PUBLIC;
  5. The SELECT privilege being granted to the user IVAN by the user ALEX:

    GRANT SELECT ON TABLE EMPLOYEE
      TO USER IVAN
      GRANTED BY ALEX;
  6. Granting the UPDATE privilege on the FIRST_NAME, LAST_NAME columns:

    GRANT UPDATE (FIRST_NAME, LAST_NAME) ON TABLE EMPLOYEE
      TO USER IVAN;
  7. Granting the INSERT privilege to the stored procedure ADD_EMP_PROJ:

    GRANT INSERT ON EMPLOYEE_PROJECT
      TO PROCEDURE ADD_EMP_PROJ;