CREATE_ACCESS_METHOD(7pg15)

πŸ“¦ version 15.19, in opensuse-leap 16.0

🌸 NAME 🌸

okay bestie, this is the CREATE ACCESS METHOD page (a.k.a. CREATE_ACCESS_METHOD(7pg15)) from the PostgreSQL 15.19 Documentation, and it is literally about defining a new access method. no cap.

  • CREATE ACCESS METHOD β€” define a new access method. yes, you are inventing a whole new access path, main character energy πŸ”₯

✨ SYNOPSIS ✨

here is the syntax, copy it exactly bestie:

CREATE ACCESS METHOD name
    TYPE access_method_type
    HANDLER handler_function

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so CREATE ACCESS METHOD creates a new access method. that is the whole vibe.

The access method name must be unique within the database. no duplicates, periodt πŸ’…

Only superusers can define new access methods. so if you are not a superuser, this is not your moment β€” ask a superuser bestie 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of the access method to be created. pick something cute and unique, iykyk.
  • access_method_type β€” this clause specifies the type of access method to define. Only TABLE and INDEX are supported at present. that is the whole menu, bestie.
  • handler_function β€” handler_function 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. yes this is the highkey important one πŸ‘‘

πŸ’– EXAMPLES πŸ’–

Create an index access method heptree with handler function heptree_handler:

CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler;

slay, that is the whole example πŸŽ€


🌈 COMPATIBILITY 🌈

CREATE ACCESS METHOD is a PostgreSQL extension. iconic, homegrown, periodt ✨


πŸ”₯ SEE ALSO πŸ”₯


That is the whole page, bestie! Sourced from PostgreSQL 15.19, dated 2026 β€” mwah πŸ’‹

πŸ“¦ where this page comes from