{
    "content": [
        {
            "type": "text",
            "text": "# ALTER_PUBLICATION (man)\n\n## NAME\n\nALTERPUBLICATION - change the definition of a publication\n\n## SYNOPSIS\n\nALTER PUBLICATION name ADD TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name DROP TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET ( publicationparameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER PUBLICATION name RENAME TO newname\n\n## DESCRIPTION\n\nThe command ALTER PUBLICATION can change the attributes of a publication.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **EXAMPLES**\n- **COMPATIBILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ALTER_PUBLICATION",
        "section": "",
        "mode": "man",
        "summary": "ALTERPUBLICATION - change the definition of a publication",
        "synopsis": "ALTER PUBLICATION name ADD TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name DROP TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET ( publicationparameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER PUBLICATION name RENAME TO newname",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "Change the publication to publish only deletes and updates:",
            "ALTER PUBLICATION noinsert SET (publish = 'update, delete');",
            "Add some tables to the publication:",
            "ALTER PUBLICATION mypublication ADD TABLE users, departments;"
        ],
        "see_also": [
            {
                "name": "CREATEPUBLICATION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATEPUBLICATION/7/json"
            },
            {
                "name": "DROPPUBLICATION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPPUBLICATION/7/json"
            },
            {
                "name": "CREATESUBSCRIPTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATESUBSCRIPTION/7/json"
            },
            {
                "name": "ALTERSUBSCRIPTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/ALTERSUBSCRIPTION/7/json"
            },
            {
                "name": "PUBLICATION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/PUBLICATION/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "ALTERPUBLICATION - change the definition of a publication\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "ALTER PUBLICATION name ADD TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name DROP TABLE [ ONLY ] tablename [ * ] [, ...]\nALTER PUBLICATION name SET ( publicationparameter [= value] [, ... ] )\nALTER PUBLICATION name OWNER TO { newowner | CURRENTROLE | CURRENTUSER | SESSIONUSER }\nALTER PUBLICATION name RENAME TO newname\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The command ALTER PUBLICATION can change the attributes of a publication.\n\nThe first three variants change which tables are part of the publication. The SET TABLE\nclause will replace the list of tables in the publication with the specified one. The ADD\nTABLE and DROP TABLE clauses will add and remove one or more tables from the publication.\nNote that adding tables to a publication that is already subscribed to will require a ALTER\nSUBSCRIPTION ... REFRESH PUBLICATION action on the subscribing side in order to become\neffective.\n\nThe fourth variant of this command listed in the synopsis can change all of the publication\nproperties specified in CREATE PUBLICATION (CREATEPUBLICATION(7)). Properties not mentioned\nin the command retain their previous settings.\n\nThe remaining variants change the owner and the name of the publication.\n\nYou must own the publication to use ALTER PUBLICATION. Adding a table to a publication\nadditionally requires owning that table. To alter the owner, you must also be a direct or\nindirect member of the new owning role. The new owner must have CREATE privilege on the\ndatabase. Also, the new owner of a FOR ALL TABLES publication must be a superuser. However, a\nsuperuser can change the ownership of a publication regardless of these restrictions.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "name\nThe name of an existing publication whose definition is to be altered.\n\ntablename\nName of an existing table. If ONLY is specified before the table name, only that table is\naffected. If ONLY is not specified, the table and all its descendant tables (if any) are\naffected. Optionally, * can be specified after the table name to explicitly indicate that\ndescendant tables are included.\n\nSET ( publicationparameter [= value] [, ... ] )\nThis clause alters publication parameters originally set by CREATE PUBLICATION\n(CREATEPUBLICATION(7)). See there for more information.\n\nnewowner\nThe user name of the new owner of the publication.\n\nnewname\nThe new name for the publication.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "Change the publication to publish only deletes and updates:\n\nALTER PUBLICATION noinsert SET (publish = 'update, delete');\n\nAdd some tables to the publication:\n\nALTER PUBLICATION mypublication ADD TABLE users, departments;\n",
                "subsections": []
            },
            "COMPATIBILITY": {
                "content": "ALTER PUBLICATION is a PostgreSQL extension.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "CREATE PUBLICATION (CREATEPUBLICATION(7)), DROP PUBLICATION (DROPPUBLICATION(7)), CREATE\nSUBSCRIPTION (CREATESUBSCRIPTION(7)), ALTER SUBSCRIPTION (ALTERSUBSCRIPTION(7))\n\n\n\nPostgreSQL 14.23                                2026                            ALTER PUBLICATION(7)",
                "subsections": []
            }
        }
    }
}