]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_USER_MAPPING.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_USER_MAPPING.7
1 '\" t
2 .\"     Title: ALTER USER MAPPING
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "ALTER USER MAPPING" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ALTER_USER_MAPPING \- change the definition of a user mapping
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER USER MAPPING FOR { \fIuser_name\fR | USER | CURRENT_ROLE | CURRENT_USER | SESSION_USER | PUBLIC }
36     SERVER \fIserver_name\fR
37     OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
38 .fi
39 .SH "DESCRIPTION"
40 .PP
41 \fBALTER USER MAPPING\fR
42 changes the definition of a user mapping\&.
43 .PP
44 The owner of a foreign server can alter user mappings for that server for any user\&. Also, a user can alter a user mapping for their own user name if
45 USAGE
46 privilege on the server has been granted to the user\&.
47 .SH "PARAMETERS"
48 .PP
49 \fIuser_name\fR
50 .RS 4
51 User name of the mapping\&.
52 CURRENT_ROLE,
53 CURRENT_USER, and
54 USER
55 match the name of the current user\&.
56 PUBLIC
57 is used to match all present and future user names in the system\&.
58 .RE
59 .PP
60 \fIserver_name\fR
61 .RS 4
62 Server name of the user mapping\&.
63 .RE
64 .PP
65 OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
66 .RS 4
67 Change options for the user mapping\&. The new options override any previously specified options\&.
68 ADD,
69 SET, and
70 DROP
71 specify the action to be performed\&.
72 ADD
73 is assumed if no operation is explicitly specified\&. Option names must be unique; options are also validated by the server\*(Aqs foreign\-data wrapper\&.
74 .RE
75 .SH "EXAMPLES"
76 .PP
77 Change the password for user mapping
78 bob, server
79 foo:
80 .sp
81 .if n \{\
82 .RS 4
83 .\}
84 .nf
85 ALTER USER MAPPING FOR bob SERVER foo OPTIONS (SET password \*(Aqpublic\*(Aq);
86 .fi
87 .if n \{\
88 .RE
89 .\}
90 .SH "COMPATIBILITY"
91 .PP
92 \fBALTER USER MAPPING\fR
93 conforms to ISO/IEC 9075\-9 (SQL/MED)\&. There is a subtle syntax issue: The standard omits the
94 FOR
95 key word\&. Since both
96 CREATE USER MAPPING
97 and
98 DROP USER MAPPING
99 use
100 FOR
101 in analogous positions, and IBM DB2 (being the other major SQL/MED implementation) also requires it for
102 ALTER USER MAPPING, PostgreSQL diverges from the standard here in the interest of consistency and interoperability\&.
103 .SH "SEE ALSO"
104 CREATE USER MAPPING (\fBCREATE_USER_MAPPING\fR(7)), DROP USER MAPPING (\fBDROP_USER_MAPPING\fR(7))