Retrieving all schemata for a user
Hi, I wonder if anyone knows how I can retrieve all schemata on which a user has been granted permissions/authorization. I have checked most of the hinting tables I get from querying
select id, name, schema_id, query from sys.tables where system = true;
but I have had no luck with that. I only get the default schema for every user when I perform the following:
select * from sys.users
Any ideas or suggestions are welcome. Thanks! Luis Ángel. The information transmitted, including any attachments, is intended only for the individual or entity to which it is addressed, and may contain confidential and/or privileged information. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by individuals or entities other than the intended recipient is prohibited, and all liability arising therefrom is disclaimed. If you have received this communication in error, please delete the information from any computer and notify the sender.
You could start with: SELECT a1.name, a2.name FROM sys.auths a1, sys.auths a2, sys.user_role ur WHERE a1.id = ur.login_id AND a2.id = ur.role_id ORDER BY a1.name, a2.name; For more details, look at the source code for msqldump, the program to dump the database. In particular, look at the queries defined in the function dump_database() in the file clients/mapiclient/dump.c. (That's what I would have to do to fully answer the question.) On 05/05/2017 10:45 PM, Luis Larios wrote:
Hi,
I wonder if anyone knows how I can retrieve all schemata on which a user has been granted permissions/authorization. I have checked most of the hinting tables I get from querying
select id, name, schema_id, query from sys.tables where system = true;
but I have had no luck with that. I only get the default schema for every user when I perform the following:
select * from sys.users
Any ideas or suggestions are welcome.
Thanks!
Luis Ángel.
The information transmitted, including any attachments, is intended only for the individual or entity to which it is addressed, and may contain confidential and/or privileged information. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by individuals or entities other than the intended recipient is prohibited, and all liability arising therefrom is disclaimed. If you have received this communication in error, please delete the information from any computer and notify the sender.
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender
participants (2)
-
Luis Larios
-
Sjoerd Mullender