CREATE_OPERATOR_FAMILY(7pg15)

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

🌸 NAME 🌸

okay so this is the CREATE_OPERATOR_FAMILY(7pg15) page, and it's literally here to explain how to define a new operator family in PostgreSQL. bestie, we're building infrastructure πŸ’…βœ¨

✨ SYNOPSIS ✨

CREATE OPERATOR FAMILY name USING index_method

πŸ’… DESCRIPTION πŸ’…

CREATE OPERATOR FAMILY creates a new operator family. no cap, that's the whole main-character move 🫢

An operator family defines a collection of related operator classes, and perhaps some additional operators and support functions that are compatible with these operator classes but not essential for the functioning of any individual index. (Operators and functions that are essential to indexes should be grouped within the relevant operator class, rather than being β€œloose” in the operator family. Typically, single-data-type operators are bound to operator classes, while cross-data-type operators can be loose in an operator family containing operator classes for both data types.) it's giving organized-but-with-a-little-loose-sparkle ✨

The new operator family is initially empty. it starts as a blank canvas 🎨 It should be populated by issuing subsequent CREATE OPERATOR CLASS commands to add contained operator classes, and optionally ALTER OPERATOR FAMILY commands to add β€œloose” operators and their corresponding support functions.

If a schema name is given then the operator family is created in the specified schema. Otherwise it is created in the current schema. Two operator families in the same schema can have the same name only if they are for different index methods. that's the schema tea β˜•

The user who defines an operator family becomes its owner. Presently, the creating user must be a superuser. (This restriction is made because an erroneous operator family definition could confuse or even crash the server.) πŸ‘‘βš οΈ

bestie, pls take that superuser warning seriously β€” an erroneous operator family definition could confuse or even crash the server. not a cute look πŸ’€

Refer to Section 38.16 for further information. go read the lore if you want the full deep dive πŸ“–

πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of the operator family to be created. The name can be schema-qualified. yes, you can bring the schema along for the ride πŸŽ€
  • index_method β€” the name of the index method this operator family is for. keep it exact, bestie 🧚

🌈 COMPATIBILITY 🌈

CREATE OPERATOR FAMILY is a PostgreSQL extension. There is no CREATE OPERATOR FAMILY statement in the SQL standard. PostgreSQL said β€œI'll do it myself” πŸ’…βœ¨

πŸ¦‹ SEE ALSO πŸ¦‹


okay bye bestie 🫢 this page is from PostgreSQL 15.19, dated 2026, and the original footer labels it CREATE OP...OR FAMILY(7). iconic documentation behavior, honestly πŸ’–

πŸ“¦ where this page comes from