{
    "content": [
        {
            "type": "text",
            "text": "# DROP_ROUTINE(7) (man)\n\n**Summary:** DROPROUTINE - remove a routine\n\n**Synopsis:** DROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]\n\n## Examples\n\n- `To drop the routine foo for type integer:`\n- `DROP ROUTINE foo(integer);`\n- `This command will work independent of whether foo is an aggregate, function, or procedure.`\n\n## See Also\n\n- DROPAGGREGATE(7)\n- DROPFUNCTION(7)\n- DROPPROCEDURE(7)\n- ALTERROUTINE(7)\n- ROUTINE(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (5 lines)\n- **NOTES** (13 lines)\n- **EXAMPLES** (6 lines)\n- **COMPATIBILITY** (11 lines)\n- **SEE ALSO** (8 lines)\n\n## Full Content\n\n### NAME\n\nDROPROUTINE - remove a routine\n\n### SYNOPSIS\n\nDROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]\n\n### DESCRIPTION\n\nDROP ROUTINE removes the definition of one or more existing routines. The term “routine”\nincludes aggregate functions, normal functions, and procedures. See under DROP AGGREGATE\n(DROPAGGREGATE(7)), DROP FUNCTION (DROPFUNCTION(7)), and DROP PROCEDURE (DROPPROCEDURE(7))\nfor the description of the parameters, more examples, and further details.\n\n### NOTES\n\nThe lookup rules used by DROP ROUTINE are fundamentally the same as for DROP PROCEDURE; in\nparticular, DROP ROUTINE shares that command's behavior of considering an argument list that\nhas no argmode markers to be possibly using the SQL standard's definition that OUT arguments\nare included in the list. (DROP AGGREGATE and DROP FUNCTION do not do that.)\n\nIn some cases where the same name is shared by routines of different kinds, it is possible\nfor DROP ROUTINE to fail with an ambiguity error when a more specific command (DROP FUNCTION,\netc.) would work. Specifying the argument type list more carefully will also resolve such\nproblems.\n\nThese lookup rules are also used by other commands that act on existing routines, such as\nALTER ROUTINE and COMMENT ON ROUTINE.\n\n### EXAMPLES\n\nTo drop the routine foo for type integer:\n\nDROP ROUTINE foo(integer);\n\nThis command will work independent of whether foo is an aggregate, function, or procedure.\n\n### COMPATIBILITY\n\nThis command conforms to the SQL standard, with these PostgreSQL extensions:\n\n•   The standard only allows one routine to be dropped per command.\n\n•   The IF EXISTS option is an extension.\n\n•   The ability to specify argument modes and names is an extension, and the lookup rules\ndiffer when modes are given.\n\n•   User-definable aggregate functions are an extension.\n\n### SEE ALSO\n\nDROP AGGREGATE (DROPAGGREGATE(7)), DROP FUNCTION (DROPFUNCTION(7)), DROP PROCEDURE\n(DROPPROCEDURE(7)), ALTER ROUTINE (ALTERROUTINE(7))\n\nNote that there is no CREATE ROUTINE command.\n\n\n\nPostgreSQL 14.23                                2026                                 DROP ROUTINE(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "DROP_ROUTINE",
        "section": "7",
        "mode": "man",
        "summary": "DROPROUTINE - remove a routine",
        "synopsis": "DROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]",
        "flags": [],
        "examples": [
            "To drop the routine foo for type integer:",
            "DROP ROUTINE foo(integer);",
            "This command will work independent of whether foo is an aggregate, function, or procedure."
        ],
        "see_also": [
            {
                "name": "DROPAGGREGATE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPAGGREGATE/7/json"
            },
            {
                "name": "DROPFUNCTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPFUNCTION/7/json"
            },
            {
                "name": "DROPPROCEDURE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPPROCEDURE/7/json"
            },
            {
                "name": "ALTERROUTINE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/ALTERROUTINE/7/json"
            },
            {
                "name": "ROUTINE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/ROUTINE/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            }
        ]
    }
}