DROP_ACCESS_METHOD(7pg14)

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

πŸ’… DROP ACCESS METHOD πŸ’…

okay so bestie, welcome to the DROP ACCESS METHOD page from the PostgreSQL 14.24 documentation β€” yes the actual manual, and yes i'm gonna make it make sense 🫢


✨ NAME ✨

DROP_ACCESS_METHOD β€” bestie. it literally removes an access method. that's the whole gig πŸ’€


🌸 SYNOPSIS 🌸

DROP ACCESS METHOD [ IF EXISTS ] name [ CASCADE | RESTRICT ]

look at her. iconic. the square brackets are optional bits, iykyk πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so DROP ACCESS METHOD removes an existing access method. that's it, that's the plot πŸŽ€

but here's the thing β€” only superusers can drop access methods. like, this is not a group-chat-casual operation, this is main character with admin privileges energy. if you're not a superuser, no cap, you're not doing this πŸ™ˆ


πŸ’– PARAMETERS πŸ’–

  • IF EXISTS β€” do not throw an error if the access method does not exist. instead a notice is issued in this case. so like, it won't yell at you, it'll just quietly be like "hey btw that one's not here" ✨
  • name β€” the name of an existing access method. literally just the name. slay.
  • CASCADE β€” automatically drop objects that depend on the access method (such as operator classes, operator families, and indexes), and in turn all objects that depend on those objects (see Section 5.14). this is the "take everything down with me" option πŸ”₯ like ok chain reaction, we love a domino moment
  • RESTRICT β€” refuse to drop the access method if any objects depend on it. This is the default. so if you don't say anything, she's cautious. respectful. boundaries πŸ’…
bestie warning: CASCADE is not playing around β€” it takes the dependents too, and then the things that depend on those. know what you're doing fr fr 😭

πŸ“ EXAMPLES πŸ“

drop the access method heptree:

DROP ACCESS METHOD heptree;

short. sweet. devastating. periodt πŸ’€βœ¨


🌈 COMPATIBILITY 🌈

DROP ACCESS METHOD is a PostgreSQL extension. so yeah, this one's our girl, not standard SQL 🫢


⭐ SEE ALSO ⭐

  • CREATE ACCESS METHOD (CREATE_ACCESS_METHOD(7)) β€” the reverse situation, the origin story, the beginning 🧚

and that's the whole page bestie, you ate πŸ’œ

PostgreSQL 14.24 Β· 2026 Β· DROP ACCESS METHOD(7) β€” mwah, go drop (or don't drop) responsibly πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from