CREATE_ACCESS_METHOD(7pg17)
π CREATE ACCESS METHOD(7) π
okay bestie, this is the PostgreSQL 17.11 Documentation page for CREATE ACCESS METHOD β yes, thatβs the title and the manual name, weβre doing this β¨
πΈ NAME πΈ
CREATE_ACCESS_METHOD β define a new access method. Thatβs the whole vibe: youβre making a brand-new access method, periodt π
π SYNOPSIS π
CREATE ACCESS METHOD name
TYPE access_method_type
HANDLER handler_function
π¦ DESCRIPTION π¦
CREATE ACCESS METHOD creates a new access method. Slay.
The access method name must be unique within the database. No duplicates, bestie β the database said one of each π
Only superusers can define new access methods. So if youβre not a superuser, this is not your main character moment π
π PARAMETERS π
nameβ the name of the access method youβre creating. Cute. Name it something iconic πaccess_method_typeβ this clause specifies the type of access method to define. OnlyTABLEandINDEXare supported at present. Thatβs the whole menu, no secret flavors πhandler_functionβhandler_functionis 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 typeinternal, and its return type depends on the type of access method; forTABLEaccess methods, it must betable_am_handlerand forINDEXaccess methods, it must beindex_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 61 and the index access method API is described in Chapter 62. iykyk, thatβs the deep lore π
β¨ EXAMPLES β¨
Create an index access method heptree with handler function heptree_handler:
CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;
Ate. No cap. Thatβs literally the example π«
π« COMPATIBILITY π«
CREATE ACCESS METHOD is a PostgreSQL extension. Just a PostgreSQL extension, bestie π«Ά
π SEE ALSO π
DROP ACCESS METHOD (DROP_ACCESS_METHOD(7))CREATE OPERATOR CLASS (CREATE_OPERATOR_CLASS(7))CREATE OPERATOR FAMILY (CREATE_OPERATOR_FAMILY(7))
signing off with PostgreSQL 17.11, dated 2026, on the CREATE ACCESS METHOD(7) page β bye bestie, mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms