DROP_TEXT_SEARCH_TEMPLATE(7pg14)

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

πŸ’… DROP_TEXT_SEARCH_TEMPLATE πŸ’…

okay so bestie, lemme tell you about DROP_TEXT_SEARCH_TEMPLATE β€” yes that's a whole mouthful, we know, but it's literally the glow-up moment for your text search templates. This command is the one that removes an existing text search template from your database. periodt.

but real talk: you gotta be a superuser to even touch this command. no cap. it's giving exclusive VIP access only. πŸ‘‘


✨ SYNOPSIS ✨

DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] name [ CASCADE | RESTRICT ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so DROP TEXT SEARCH TEMPLATE literally drops an existing text search template. that's it, that's the whole vibe. but the catch? you must be a superuser to use this command. ngl, it's a whole permission thing. if you're not a superuser, this command said "not me being inaccessible to you" πŸ™ˆ


πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” okay so this is the chill option. it means: don't throw an error if the text search template doesn't exist. instead, a notice is issued in this case. it's giving "no drama, we move". πŸ’–
  • name β€” the name of an existing text search template. and yes, it can be optionally schema-qualified if you're feeling fancy. slay. 🌸
  • CASCADE β€” this is the main character energy option, fr fr. it automatically drops objects that depend on the text search template, and in turn all objects that depend on those objects. it's a whole chain reaction of dropping. (see Section 5.14 for the full tea β˜•)
  • RESTRICT β€” the cautious queen. this refuses to drop the text search template if any objects depend on it. and guess what? this is the default. so if you don't specify anything, the command is lowkey protective by default. 🫢

πŸ’œ EXAMPLES πŸ’œ

okay so let's say you wanna remove the text search template thesaurus. here's the move:

DROP TEXT SEARCH TEMPLATE thesaurus;

but bestie, listen β€” this command will not succeed if there are any existing text search dictionaries that use the template. 😭 it's giving "you can't sit with us" energy.

if you really wanna drop those dictionaries along with the template, you gotta add CASCADE. that's the "I said what I said" option. πŸ”₯


🌈 COMPATIBILITY 🌈

so here's the thing β€” there is literally no DROP TEXT SEARCH TEMPLATE statement in the SQL standard. like, at all. it's simply not a thing there. so if you're looking for standard compliance, this ain't it. but that's okay, we love a unique icon. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘


⚠️ quick reminder bestie: superuser only. don't forget. the command will literally not work otherwise and that's just how it is. πŸ’€

okay that's the whole page! this was PostgreSQL 14.24 documentation, dated 2026 β€” mwah! πŸ’–βœ¨ stay slay, stay dropping templates responsibly, and remember: CASCADE is powerful so use her wisely. πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from