---
title: "ALTER SERVER"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_alter_server/"
---

# ALTER SERVER

Use the ALTER SERVER statement to create alter a foreign server.

## Synopsis

Use the `ALTER SERVER` command to alter the definition of a foreign server. The command can be used to alter the options of the foreign server, or to change its owner.

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
alter_server ::= ALTER SERVER server_name [ VERSION server_version ]  
                 [ OPTIONS ( alter_fdw_options ) ] 
                 [ OWNER TO new_owner ]
```

#### alter\_server

ALTERSERVER[server\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#server-name)VERSION[server\_version](/stable/api/ysql/syntax_resources/grammar_diagrams#server-version)OPTIONS([alter\_fdw\_options](/stable/api/ysql/syntax_resources/grammar_diagrams#alter-fdw-options))OWNERTO[new\_owner](/stable/api/ysql/syntax_resources/grammar_diagrams#new-owner)

## Semantics

Alter the foreign server named **server\_name**.

### Version

The `VERSION` clause can be used to specify the updated version of the server.

### Options

The `OPTIONS` clause can be used to specify the new options of the foreign server. `ADD`, `SET`, and `DROP` specify the action to be performed. `ADD` is assumed if no operation is explicitly specified.

## Examples

Change the server's version to `2.0`, set `opt1` to `'true'`, and drop `opt2`.

```plpgsql
yugabyte=# ALTER SERVER my_server SERVER VERSION '2.0' OPTIONS (SET opt1 'true', DROP opt2);
```

## See also

- [CREATE SERVER](/stable/api/ysql/the-sql-language/statements/ddl_create_server/ "CREATE SERVER")
- [DROP SERVER](/stable/api/ysql/the-sql-language/statements/ddl_drop_server/ "DROP SERVER")
