{
    "content": [
        {
            "type": "text",
            "text": "# ALTER_TABLESPACE(7) (man)\n\n**Summary:** ALTERTABLESPACE - change the definition of a tablespace\n\n**Synopsis:** ALTER TABLESPACE name RENAME TO newname\nALTER TABLESPACE name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER TABLESPACE name SET ( tablespaceoption = value [, ... ] )\nALTER TABLESPACE name RESET ( tablespaceoption [, ... ] )\n\n## Examples\n\n- `Rename tablespace indexspace to fastraid:`\n- `ALTER TABLESPACE indexspace RENAME TO fastraid;`\n- `Change the owner of tablespace indexspace:`\n- `ALTER TABLESPACE indexspace OWNER TO mary;`\n\n## See Also\n\n- CREATETABLESPACE(7)\n- DROPTABLESPACE(7)\n- TABLESPACE(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (5 lines)\n- **DESCRIPTION** (6 lines)\n- **PARAMETERS** (20 lines)\n- **EXAMPLES** (8 lines)\n- **COMPATIBILITY** (2 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\nALTERTABLESPACE - change the definition of a tablespace\n\n### SYNOPSIS\n\nALTER TABLESPACE name RENAME TO newname\nALTER TABLESPACE name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER TABLESPACE name SET ( tablespaceoption = value [, ... ] )\nALTER TABLESPACE name RESET ( tablespaceoption [, ... ] )\n\n### DESCRIPTION\n\nALTER TABLESPACE can be used to change the definition of a tablespace.\n\nYou must own the tablespace to change the definition of a tablespace. To alter the owner, you\nmust also be a direct or indirect member of the new owning role. (Note that superusers have\nthese privileges automatically.)\n\n### PARAMETERS\n\nname\nThe name of an existing tablespace.\n\nnewname\nThe new name of the tablespace. The new name cannot begin with pg, as such names are\nreserved for system tablespaces.\n\nnewowner\nThe new owner of the tablespace.\n\ntablespaceoption\nA tablespace parameter to be set or reset. Currently, the only available parameters are\nseqpagecost, randompagecost, effectiveioconcurrency and maintenanceioconcurrency.\nSetting these values for a particular tablespace will override the planner's usual\nestimate of the cost of reading pages from tables in that tablespace, and the executor's\nprefetching behavior, as established by the configuration parameters of the same name\n(see seqpagecost, randompagecost, effectiveioconcurrency,\nmaintenanceioconcurrency). This may be useful if one tablespace is located on a disk\nwhich is faster or slower than the remainder of the I/O subsystem.\n\n### EXAMPLES\n\nRename tablespace indexspace to fastraid:\n\nALTER TABLESPACE indexspace RENAME TO fastraid;\n\nChange the owner of tablespace indexspace:\n\nALTER TABLESPACE indexspace OWNER TO mary;\n\n### COMPATIBILITY\n\nThere is no ALTER TABLESPACE statement in the SQL standard.\n\n### SEE ALSO\n\nCREATE TABLESPACE (CREATETABLESPACE(7)), DROP TABLESPACE (DROPTABLESPACE(7))\n\n\n\nPostgreSQL 14.23                                2026                             ALTER TABLESPACE(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "ALTER_TABLESPACE",
        "section": "7",
        "mode": "man",
        "summary": "ALTERTABLESPACE - change the definition of a tablespace",
        "synopsis": "ALTER TABLESPACE name RENAME TO newname\nALTER TABLESPACE name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER TABLESPACE name SET ( tablespaceoption = value [, ... ] )\nALTER TABLESPACE name RESET ( tablespaceoption [, ... ] )",
        "flags": [],
        "examples": [
            "Rename tablespace indexspace to fastraid:",
            "ALTER TABLESPACE indexspace RENAME TO fastraid;",
            "Change the owner of tablespace indexspace:",
            "ALTER TABLESPACE indexspace OWNER TO mary;"
        ],
        "see_also": [
            {
                "name": "CREATETABLESPACE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATETABLESPACE/7/json"
            },
            {
                "name": "DROPTABLESPACE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPTABLESPACE/7/json"
            },
            {
                "name": "TABLESPACE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/TABLESPACE/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}