2 .\" Title: CREATE ACCESS METHOD
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "CREATE ACCESS METHOD" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 CREATE_ACCESS_METHOD \- define a new access method
35 CREATE ACCESS METHOD \fIname\fR
36 TYPE \fIaccess_method_type\fR
37 HANDLER \fIhandler_function\fR
41 \fBCREATE ACCESS METHOD\fR
42 creates a new access method\&.
44 The access method name must be unique within the database\&.
46 Only superusers can define new access methods\&.
51 The name of the access method to be created\&.
54 \fIaccess_method_type\fR
56 This clause specifies the type of access method to define\&. Only
60 are supported at present\&.
63 \fIhandler_function\fR
65 \fIhandler_function\fR
66 is the name (possibly schema\-qualified) of a previously registered function that represents the access method\&. The handler function must be declared to take a single argument of type
67 internal, and its return type depends on the type of access method; for
69 access methods, it must be
73 access methods, it must be
74 index_am_handler\&. The C\-level API that the handler function must implement varies depending on the type of access method\&. The table access method API is described in
76 and the index access method API is described in
81 Create an index access method
90 CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;
97 \fBCREATE ACCESS METHOD\fR
102 DROP ACCESS METHOD (\fBDROP_ACCESS_METHOD\fR(7)), CREATE OPERATOR CLASS (\fBCREATE_OPERATOR_CLASS\fR(7)), CREATE OPERATOR FAMILY (\fBCREATE_OPERATOR_FAMILY\fR(7))