]> begriffs open source - ai-pg/blob - full-docs/txt/sql-alterserver.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-alterserver.txt
1
2 ALTER SERVER
3
4    ALTER SERVER — change the definition of a foreign server
5
6 Synopsis
7
8 ALTER SERVER name [ VERSION 'new_version' ]
9     [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
10 ALTER SERVER name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_U
11 SER }
12 ALTER SERVER name RENAME TO new_name
13
14 Description
15
16    ALTER SERVER changes the definition of a foreign server. The first form
17    changes the server version string or the generic options of the server
18    (at least one clause is required). The second form changes the owner of
19    the server.
20
21    To alter the server you must be the owner of the server. Additionally
22    to alter the owner, you must be able to SET ROLE to the new owning
23    role, and you must have USAGE privilege on the server's foreign-data
24    wrapper. (Note that superusers satisfy all these criteria
25    automatically.)
26
27 Parameters
28
29    name
30           The name of an existing server.
31
32    new_version
33           New server version.
34
35    OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
36           Change options for the server. ADD, SET, and DROP specify the
37           action to be performed. ADD is assumed if no operation is
38           explicitly specified. Option names must be unique; names and
39           values are also validated using the server's foreign-data
40           wrapper library.
41
42    new_owner
43           The user name of the new owner of the foreign server.
44
45    new_name
46           The new name for the foreign server.
47
48 Examples
49
50    Alter server foo, add connection options:
51 ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
52
53    Alter server foo, change version, change host option:
54 ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');
55
56 Compatibility
57
58    ALTER SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO and
59    RENAME forms are PostgreSQL extensions.
60
61 See Also
62
63    CREATE SERVER, DROP SERVER