man > ALTER_SERVER(7)

🏷️ NAME

ALTER SERVER β€” change the definition of a foreign server

πŸš€ Quick Reference

Use CaseCommandDescription
Change server versionALTER SERVER name VERSION 'new_version'Update the version string of the foreign server.
Add connection optionsALTER SERVER name OPTIONS (ADD option 'value')Add new options to the server.
Set an optionALTER SERVER name OPTIONS (SET option 'value')Modify an existing option’s value.
Drop an optionALTER SERVER name OPTIONS (DROP option)Remove an option from the server.
Change ownerALTER SERVER name OWNER TO new_ownerTransfer ownership of the server.
Rename serverALTER SERVER name RENAME TO new_nameRename the foreign server.
Example: add connection optionsALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');Add host and dbname options to server foo.
Example: change version and hostALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');Update version to 8.4 and set host to 'baz'.

πŸ“‹ SYNOPSIS

ALTER SERVER name [ VERSION 'new_version' ]
    [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
ALTER SERVER name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER SERVER name RENAME TO new_name

πŸ“ DESCRIPTION

πŸ”§ ALTER SERVER changes the definition of a foreign server. The first form changes the server version string or the generic options of the server (at least one clause is required). The second form changes the owner of the server.

πŸ”‘ To alter the server you must be the owner of the server. Additionally to alter the owner, you must own the server and also be a direct or indirect member of the new owning role, and you must have πŸ“¦ USAGE privilege on the server’s foreign‑data wrapper. (🦸 Note that superusers satisfy all these criteria automatically.)

βš™οΈ PARAMETERS

πŸ’‘ EXAMPLES

πŸ”— Alter server foo, add connection options:

ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');

πŸ”„ Alter server foo, change version, and change the host option:

ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');

πŸ“œ COMPATIBILITY

πŸ“ ALTER SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO and RENAME forms are PostgreSQL extensions.

πŸ“š SEE ALSO

πŸ”§ CREATE SERVER(7)β€ƒπŸ—‘οΈ DROP SERVER(7)

πŸ“… PostgreSQL 14.23 β€” 2026 β€” ALTER SERVER(7)

ALTER_SERVER(7)
🏷️ NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“ DESCRIPTION βš™οΈ PARAMETERS πŸ’‘ EXAMPLES πŸ“œ COMPATIBILITY πŸ“š SEE ALSO

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 20:41 @2600:1f28:365:80b0:b91e:58eb:6587:15c8
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format