Book Contents

Book Index

Next Topic

Home

GRANT (Schema)

Grants privileges on a schema to a database user.

In a database with trust authentication, the GRANT and REVOKE statements appear to work as expected but have no actual effect on the security of the database.

Syntax

GRANT { { CREATE | USAGE } [, ...]

| ALL [ PRIVILEGES ]

}

ON SCHEMA schema-name [, ...]

TO { username | PUBLIC } [, ...]

[ WITH GRANT OPTION ]

Semantics

 

CREATE

allows username to create new tables.

USAGE

allows username to access all existing tables.

ALL

is synonymous with CREATE.

PRIVILEGES

is for SQL standard compatibility and is ignored.

schema-name

there is only one schema in 2.1.GA which is named PUBLIC.

username

grants the privilege to a specific user.

PUBLIC

grants the privilege to all users.

WITH GRANT

OPTION

allows the recipient of the privilege to grant it to other users.

Notes