From 635ba3ea00ec97d545f0e3bc537d59687c7152e0 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Tue, 10 Jun 2008 11:00:19 +0000 Subject: [PATCH] Added documentation for GRANTED BY clause --- doc/sql.extensions/README.ddl.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/sql.extensions/README.ddl.txt b/doc/sql.extensions/README.ddl.txt index 78d8c4ade9..d9ee1d51f2 100644 --- a/doc/sql.extensions/README.ddl.txt +++ b/doc/sql.extensions/README.ddl.txt @@ -237,3 +237,33 @@ create view v_users as alter view v_users (id, name) as select id, name from users; + +9) GRANT/REVOKE rights GRANTED BY specified user +(Alex Peshkoff) + +Function: + +Makes it possible to specify non-default (which is CURRENT_USER) grantor in GRANT and REVOKE +commands. + +Syntax: + +grant to [ { granted by | as } [ user ] ] +revoke from [ { granted by | as } [ user ] ] + +Example (as SYSDBA): + +create role r1; +grant r1 to user1 with admin option; +grant r1 to public granted by user1; + +(in isql) +show grant; +/* Grant permissions for this database */ +GRANT R1 TO PUBLIC GRANTED BY USER1 +GRANT R1 TO USER1 WITH ADMIN OPTION + +Misc: +GRANTED BY form of clause is recommended by SQL standard. AS is supported by some other +servers (Informix), and is added for better compatibility. +