DROP USER MAPPING
Description
DROP USER MAPPING is used to delete the user mapping from a user to a foreign server.
Syntax
DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_USER | PUBLIC } SERVER server_name;
Parameters
-
Reports a notice instead of an error if the user mapping does not exist.
Different from many statements, the IF EXISTS parameter is used only for the DROP USER MAPPING statement. When the CREATE USER MAPPING statement uses this parameter, a syntax error is reported.
-
Specifies username of the mapping.
CURRENT_USER and USER match the name of the current user. PUBLIC is used to match all current and future usernames in the system.
-
Specifies name of the server to which the user is mapped.
Examples
-- Create a role. gaussdb=# CREATE ROLE bob PASSWORD '********'; -- Create a foreign server. gaussdb=# CREATE SERVER my_server FOREIGN DATA WRAPPER log_fdw; -- Create a user mapping. gaussdb=# CREATE USER MAPPING FOR bob SERVER my_server OPTIONS (USER 'bob', PASSWORD '********'); -- Modify the user mapping. gaussdb=# ALTER USER MAPPING FOR bob SERVER my_server OPTIONS (SET PASSWORD '********'); -- Delete the user mapping. gaussdb=# DROP USER MAPPING FOR bob SERVER my_server; -- Delete the foreign server. gaussdb=# DROP SERVER my_server; -- Delete the role. gaussdb=# DROP ROLE bob;
Helpful Links
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot