]> begriffs open source - ai-pg/blob - full-docs/txt/sql-create-access-method.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-create-access-method.txt
1
2 CREATE ACCESS METHOD
3
4    CREATE ACCESS METHOD — define a new access method
5
6 Synopsis
7
8 CREATE ACCESS METHOD name
9     TYPE access_method_type
10     HANDLER handler_function
11
12 Description
13
14    CREATE ACCESS METHOD creates a new access method.
15
16    The access method name must be unique within the database.
17
18    Only superusers can define new access methods.
19
20 Parameters
21
22    name
23           The name of the access method to be created.
24
25    access_method_type
26           This clause specifies the type of access method to define. Only
27           TABLE and INDEX are supported at present.
28
29    handler_function
30           handler_function is the name (possibly schema-qualified) of a
31           previously registered function that represents the access
32           method. The handler function must be declared to take a single
33           argument of type internal, and its return type depends on the
34           type of access method; for TABLE access methods, it must be
35           table_am_handler and for INDEX access methods, it must be
36           index_am_handler. The C-level API that the handler function must
37           implement varies depending on the type of access method. The
38           table access method API is described in Chapter 62 and the index
39           access method API is described in Chapter 63.
40
41 Examples
42
43    Create an index access method heptree with handler function
44    heptree_handler:
45 CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;
46
47 Compatibility
48
49    CREATE ACCESS METHOD is a PostgreSQL extension.
50
51 See Also
52
53    DROP ACCESS METHOD, CREATE OPERATOR CLASS, CREATE OPERATOR FAMILY