]> begriffs open source - ai-pg/blob - full-docs/man7/CREATE_ACCESS_METHOD.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / CREATE_ACCESS_METHOD.7
1 '\" t
2 .\"     Title: CREATE ACCESS METHOD
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 CREATE_ACCESS_METHOD \- define a new access method
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 CREATE ACCESS METHOD \fIname\fR
36     TYPE \fIaccess_method_type\fR
37     HANDLER \fIhandler_function\fR
38 .fi
39 .SH "DESCRIPTION"
40 .PP
41 \fBCREATE ACCESS METHOD\fR
42 creates a new access method\&.
43 .PP
44 The access method name must be unique within the database\&.
45 .PP
46 Only superusers can define new access methods\&.
47 .SH "PARAMETERS"
48 .PP
49 \fIname\fR
50 .RS 4
51 The name of the access method to be created\&.
52 .RE
53 .PP
54 \fIaccess_method_type\fR
55 .RS 4
56 This clause specifies the type of access method to define\&. Only
57 TABLE
58 and
59 INDEX
60 are supported at present\&.
61 .RE
62 .PP
63 \fIhandler_function\fR
64 .RS 4
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
68 TABLE
69 access methods, it must be
70 table_am_handler
71 and for
72 INDEX
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
75 Chapter\ \&62
76 and the index access method API is described in
77 Chapter\ \&63\&.
78 .RE
79 .SH "EXAMPLES"
80 .PP
81 Create an index access method
82 heptree
83 with handler function
84 heptree_handler:
85 .sp
86 .if n \{\
87 .RS 4
88 .\}
89 .nf
90 CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;
91 .fi
92 .if n \{\
93 .RE
94 .\}
95 .SH "COMPATIBILITY"
96 .PP
97 \fBCREATE ACCESS METHOD\fR
98 is a
99 PostgreSQL
100 extension\&.
101 .SH "SEE ALSO"
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))