DROP_TEXT_SEARCH_TEMPLATE(7pg14)
π 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 π
ALTER TEXT SEARCH TEMPLATE(ALTER_TEXT_SEARCH_TEMPLATE(7))CREATE TEXT SEARCH TEMPLATE(CREATE_TEXT_SEARCH_TEMPLATE(7))
β οΈ 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
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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