{
    "mode": "man",
    "parameter": "ALTER_SERVER",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/ALTER_SERVER/7/json",
    "generated": "2026-06-17T19:13:22Z",
    "synopsis": "ALTER SERVER name [ VERSION 'newversion' ]\n[ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]\nALTER SERVER name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER SERVER name RENAME TO newname",
    "sections": {
        "NAME": {
            "content": "ALTERSERVER - change the definition of a foreign server\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ALTER SERVER name [ VERSION 'newversion' ]\n[ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]\nALTER SERVER name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER SERVER name RENAME TO newname\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ALTER SERVER changes the definition of a foreign server. The first form changes the server\nversion string or the generic options of the server (at least one clause is required). The\nsecond form changes the owner of the server.\n\nTo alter the server you must be the owner of the server. Additionally to alter the owner, you\nmust own the server and also be a direct or indirect member of the new owning role, and you\nmust have USAGE privilege on the server's foreign-data wrapper. (Note that superusers satisfy\nall these criteria automatically.)\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "name\nThe name of an existing server.\n\nnewversion\nNew server version.\n\nOPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )\nChange options for the server.  ADD, SET, and DROP specify the action to be performed.\nADD is assumed if no operation is explicitly specified. Option names must be unique;\nnames and values are also validated using the server's foreign-data wrapper library.\n\nnewowner\nThe user name of the new owner of the foreign server.\n\nnewname\nThe new name for the foreign server.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Alter server foo, add connection options:\n\nALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb');\n\nAlter server foo, change version, change host option:\n\nALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz');\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "ALTER SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The OWNER TO and RENAME forms are\nPostgreSQL extensions.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE SERVER (CREATESERVER(7)), DROP SERVER (DROPSERVER(7))\n\n\n\nPostgreSQL 14.23                                2026                                 ALTER SERVER(7)",
            "subsections": []
        }
    },
    "summary": "ALTERSERVER - change the definition of a foreign server",
    "flags": [],
    "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');"
    ],
    "see_also": [
        {
            "name": "CREATESERVER",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATESERVER/7/json"
        },
        {
            "name": "DROPSERVER",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPSERVER/7/json"
        },
        {
            "name": "SERVER",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/SERVER/7/json"
        }
    ]
}