ALTER_SERVER(7pg17)
π ALTER_SERVER π
okay so bestie, welcome to the ALTER SERVER(7) page from the PostgreSQL 17.11 Documentation β it's all about ALTER_SERVER, aka changing the definition of a foreign server. no cap, it's giving "server glow-up" energy. π
πΈ NAME πΈ
ALTER_SERVER β change the definition of a foreign server. β¨
π¦ 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 π
Okay so ALTER SERVER changes the definition of a foreign server. The first form changes the server version string or the generic options of the server β and yes, at least one clause is required, bestie, you can't just show up with no clause. π The second form changes the owner of the server.
To alter the server you must be the owner of the server. fr fr. Additionally, to alter the owner, you must be able to SET ROLE to the new owning role, and you must have USAGE privilege on the server's foreign-data wrapper. (Not me reminding you that superusers satisfy all these criteria automatically. π)
π PARAMETERS π
nameβ the name of an existing server. πnew_versionβ new server version. π¦OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )β change options for the server.ADD,SET, andDROPspecify the action to be performed.ADDis assumed if no operation is explicitly specified. Option names must be unique; names and values are also validated using the server's foreign-data wrapper library. π₯new_ownerβ the user name of the new owner of the foreign server. πnew_nameβ the new name for the foreign server. β¨
π EXAMPLES π
Alter server foo, add connection options:
ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');
Alter server foo, change version, change 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. slay, standard compliance! β¨
π SEE ALSO π
CREATE SERVER (CREATE_SERVER(7))DROP SERVER (DROP_SERVER(7))
That's the whole page, bestie! PostgreSQL 17.11, dated 2026, manual page ALTER SERVER(7). mwah π π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms