{
    "content": [
        {
            "type": "text",
            "text": "# DROP_FUNCTION (man)\n\n## NAME\n\nDROPFUNCTION - remove a function\n\n## SYNOPSIS\n\nDROP FUNCTION [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]\n\n## DESCRIPTION\n\nDROP FUNCTION removes the definition of an existing function. To execute this command the\nuser must be the owner of the function. The argument types to the function must be specified,\nsince several different functions can exist with the same name and different argument lists.\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": "DROP_FUNCTION",
        "section": "",
        "mode": "man",
        "summary": "DROPFUNCTION - remove a function",
        "synopsis": "DROP FUNCTION [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "This command removes the square root function:",
            "DROP FUNCTION sqrt(integer);",
            "Drop multiple functions in one command:",
            "DROP FUNCTION sqrt(integer), sqrt(bigint);",
            "If the function name is unique in its schema, it can be referred to without an argument list:",
            "DROP FUNCTION updateemployeesalaries;",
            "Note that this is different from",
            "DROP FUNCTION updateemployeesalaries();",
            "which refers to a function with zero arguments, whereas the first variant can refer to a",
            "function with any number of arguments, including zero, as long as the name is unique."
        ],
        "see_also": [
            {
                "name": "CREATEFUNCTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATEFUNCTION/7/json"
            },
            {
                "name": "ALTERFUNCTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/ALTERFUNCTION/7/json"
            },
            {
                "name": "DROPPROCEDURE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPPROCEDURE/7/json"
            },
            {
                "name": "DROPROUTINE",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPROUTINE/7/json"
            },
            {
                "name": "FUNCTION",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/FUNCTION/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "DROPFUNCTION - remove a function\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "DROP FUNCTION [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]\n[ CASCADE | RESTRICT ]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "DROP FUNCTION removes the definition of an existing function. To execute this command the\nuser must be the owner of the function. The argument types to the function must be specified,\nsince several different functions can exist with the same name and different argument lists.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "IF EXISTS\nDo not throw an error if the function does not exist. A notice is issued in this case.\n\nname\nThe name (optionally schema-qualified) of an existing function. If no argument list is\nspecified, the name must be unique in its schema.\n\nargmode\nThe mode of an argument: IN, OUT, INOUT, or VARIADIC. If omitted, the default is IN. Note\nthat DROP FUNCTION does not actually pay any attention to OUT arguments, since only the\ninput arguments are needed to determine the function's identity. So it is sufficient to\nlist the IN, INOUT, and VARIADIC arguments.\n\nargname\nThe name of an argument. Note that DROP FUNCTION does not actually pay any attention to\nargument names, since only the argument data types are needed to determine the function's\nidentity.\n\nargtype\nThe data type(s) of the function's arguments (optionally schema-qualified), if any.\n\nCASCADE\nAutomatically drop objects that depend on the function (such as operators or triggers),\nand in turn all objects that depend on those objects (see Section 5.14).\n\nRESTRICT\nRefuse to drop the function if any objects depend on it. This is the default.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "This command removes the square root function:\n\nDROP FUNCTION sqrt(integer);\n\nDrop multiple functions in one command:\n\nDROP FUNCTION sqrt(integer), sqrt(bigint);\n\nIf the function name is unique in its schema, it can be referred to without an argument list:\n\nDROP FUNCTION updateemployeesalaries;\n\nNote that this is different from\n\nDROP FUNCTION updateemployeesalaries();\n\nwhich refers to a function with zero arguments, whereas the first variant can refer to a\nfunction with any number of arguments, including zero, as long as the name is unique.\n",
                "subsections": []
            },
            "COMPATIBILITY": {
                "content": "This command conforms to the SQL standard, with these PostgreSQL extensions:\n\n•   The standard only allows one function to be dropped per command.\n\n•   The IF EXISTS option\n\n•   The ability to specify argument modes and names\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "CREATE FUNCTION (CREATEFUNCTION(7)), ALTER FUNCTION (ALTERFUNCTION(7)), DROP PROCEDURE\n(DROPPROCEDURE(7)), DROP ROUTINE (DROPROUTINE(7))\n\n\n\nPostgreSQL 14.23                                2026                                DROP FUNCTION(7)",
                "subsections": []
            }
        }
    }
}