All Products
Search
Document Center

PolarDB:CREATE ACCESS METHOD

Last Updated:Mar 28, 2026

CREATE ACCESS METHOD — define a new access method.

Description

CREATE ACCESS METHOD registers a new access method in the current database. The access method name must be unique within the database. Only superusers can define new access methods.

Synopsis

CREATE ACCESS METHOD name
    TYPE access_method_type
    HANDLER handler_function

Parameters

ParameterDescription
nameThe name of the access method to create.
access_method_typeThe type of access method to define. Valid values: TABLE, INDEX.
handler_functionThe name (optionally schema-qualified) of a previously registered function that implements the access method. The handler function must accept a single argument of type internal. The return type depends on the access method type: table_am_handler for TABLE access methods, and index_am_handler for INDEX access methods. The C-level API that the handler must implement varies by type — refer to the table access method and index access method interface definitions for details.

Examples

Create an index access method named heptree with handler function heptree_handler:

CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;