{
    "content": [
        {
            "type": "text",
            "text": "# CREATE_ACCESS_METHOD(7) (man)\n\n**Summary:** CREATEACCESSMETHOD - define a new access method\n\n**Synopsis:** CREATE ACCESS METHOD name\nTYPE accessmethodtype\nHANDLER handlerfunction\n\n## Examples\n\n- `Create an index access method heptree with handler function heptreehandler:`\n- `CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptreehandler;`\n\n## See Also\n\n- DROPACCESSMETHOD(7)\n- CREATEOPERATORCLASS(7)\n- CREATEOPERATORFAMILY(7)\n- METHOD(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (6 lines)\n- **PARAMETERS** (16 lines)\n- **EXAMPLES** (4 lines)\n- **COMPATIBILITY** (2 lines)\n- **SEE ALSO** (6 lines)\n\n## Full Content\n\n### NAME\n\nCREATEACCESSMETHOD - define a new access method\n\n### SYNOPSIS\n\nCREATE ACCESS METHOD name\nTYPE accessmethodtype\nHANDLER handlerfunction\n\n### DESCRIPTION\n\nCREATE ACCESS METHOD creates a new access method.\n\nThe access method name must be unique within the database.\n\nOnly superusers can define new access methods.\n\n### PARAMETERS\n\nname\nThe name of the access method to be created.\n\naccessmethodtype\nThis clause specifies the type of access method to define. Only TABLE and INDEX are\nsupported at present.\n\nhandlerfunction\nhandlerfunction is the name (possibly schema-qualified) of a previously registered\nfunction that represents the access method. The handler function must be declared to take\na single argument of type internal, and its return type depends on the type of access\nmethod; for TABLE access methods, it must be tableamhandler and for INDEX access\nmethods, it must be indexamhandler. The C-level API that the handler function must\nimplement varies depending on the type of access method. The table access method API is\ndescribed in Chapter 61 and the index access method API is described in Chapter 62.\n\n### EXAMPLES\n\nCreate an index access method heptree with handler function heptreehandler:\n\nCREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptreehandler;\n\n### COMPATIBILITY\n\nCREATE ACCESS METHOD is a PostgreSQL extension.\n\n### SEE ALSO\n\nDROP ACCESS METHOD (DROPACCESSMETHOD(7)), CREATE OPERATOR CLASS (CREATEOPERATORCLASS(7)),\nCREATE OPERATOR FAMILY (CREATEOPERATORFAMILY(7))\n\n\n\nPostgreSQL 14.23                                2026                         CREATE ACCESS METHOD(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "CREATE_ACCESS_METHOD",
        "section": "7",
        "mode": "man",
        "summary": "CREATEACCESSMETHOD - define a new access method",
        "synopsis": "CREATE ACCESS METHOD name\nTYPE accessmethodtype\nHANDLER handlerfunction",
        "flags": [],
        "examples": [
            "Create an index access method heptree with handler function heptreehandler:",
            "CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptreehandler;"
        ],
        "see_also": [
            {
                "name": "DROPACCESSMETHOD",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/DROPACCESSMETHOD/7/json"
            },
            {
                "name": "CREATEOPERATORCLASS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATEOPERATORCLASS/7/json"
            },
            {
                "name": "CREATEOPERATORFAMILY",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/CREATEOPERATORFAMILY/7/json"
            },
            {
                "name": "METHOD",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/METHOD/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}