ALTER_SERVER(7pg17)

πŸ“¦ version 17.11, in opensuse-leap 16.0

πŸ’… 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, and DROP specify the action to be performed. ADD is 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 🌟


That's the whole page, bestie! PostgreSQL 17.11, dated 2026, manual page ALTER SERVER(7). mwah πŸ’‹ 🫢

πŸ“¦ where this page comes from