summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/man7/CREATE_ACCESS_METHOD.7
blob: b477904e255f3104c8cbdd6c54058fdc981cf2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
'\" t
.\"     Title: CREATE ACCESS METHOD
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2024
.\"    Manual: PostgreSQL 15.7 Documentation
.\"    Source: PostgreSQL 15.7
.\"  Language: English
.\"
.TH "CREATE ACCESS METHOD" "7" "2024" "PostgreSQL 15.7" "PostgreSQL 15.7 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
CREATE_ACCESS_METHOD \- define a new access method
.SH "SYNOPSIS"
.sp
.nf
CREATE ACCESS METHOD \fIname\fR
    TYPE \fIaccess_method_type\fR
    HANDLER \fIhandler_function\fR
.fi
.SH "DESCRIPTION"
.PP
\fBCREATE ACCESS METHOD\fR
creates a new access method\&.
.PP
The access method name must be unique within the database\&.
.PP
Only superusers can define new access methods\&.
.SH "PARAMETERS"
.PP
\fIname\fR
.RS 4
The name of the access method to be created\&.
.RE
.PP
\fIaccess_method_type\fR
.RS 4
This clause specifies the type of access method to define\&. Only
TABLE
and
INDEX
are supported at present\&.
.RE
.PP
\fIhandler_function\fR
.RS 4
\fIhandler_function\fR
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
internal, and its return type depends on the type of access method; for
TABLE
access methods, it must be
table_am_handler
and for
INDEX
access methods, it must be
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
Chapter\ \&63
and the index access method API is described in
Chapter\ \&64\&.
.RE
.SH "EXAMPLES"
.PP
Create an index access method
heptree
with handler function
heptree_handler:
.sp
.if n \{\
.RS 4
.\}
.nf
CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;
.fi
.if n \{\
.RE
.\}
.SH "COMPATIBILITY"
.PP
\fBCREATE ACCESS METHOD\fR
is a
PostgreSQL
extension\&.
.SH "SEE ALSO"
DROP ACCESS METHOD (\fBDROP_ACCESS_METHOD\fR(7)), CREATE OPERATOR CLASS (\fBCREATE_OPERATOR_CLASS\fR(7)), CREATE OPERATOR FAMILY (\fBCREATE_OPERATOR_FAMILY\fR(7))