DROP_TEXT_SEARCH_TEMPLATE(7pg16)
π DROP_TEXT_SEARCH_TEMPLATE(7) β the PostgreSQL 16.15 glow-up edit β¨
okay bestie, so we're deep in the PostgreSQL 16.15 documentation and this little icon is DROP_TEXT_SEARCH_TEMPLATE, living its best life in section 7. let me walk you through it π«Ά
πΈ NAME πΈ
DROP_TEXT_SEARCH_TEMPLATE β literally just yeets a text search template out of existence. remove a text search template, that's the whole gig π
β¨ SYNOPSIS β¨
DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] name [ CASCADE | RESTRICT ]
that's it. that's the incantation. memorize it, screenshot it, put it on your lock screen π
π¦ DESCRIPTION π¦
DROP TEXT SEARCH TEMPLATE drops an existing text search template.
like, gone. poof. π¨
but here's the vibe check, bestie:
You must be a superuser to use this command.
no cap. if you're not a superuser, this is not your moment. this is not your era. hand the keyboard to someone with the credentials π
π PARAMETERS π
IF EXISTSβ do not throw an error if the text search template doesn't exist. instead, a notice gets issued, which is honestly so much gentler. it's giving "no drama, just a lil heads up" πnameβ the name of an existing text search template. and yes, it can be optionally schema-qualified, so you can be all specific and fancy about it if you want πCASCADEβ automatically drops objects that depend on the text search template, and, in turn, all objects that depend on those objects. the domino effect, the chain reaction, the whole ripple. (see Section 5.14 for the full lore π)RESTRICTβ refuses to drop the text search template if any objects depend on it. this is the default, so lowkey this is what you get unless you say otherwise. it's the safe, sensible, protective bestie of the two π
π EXAMPLES π
okay so say you wanna remove the text search template thesaurus. you literally just:
DROP TEXT SEARCH TEMPLATE thesaurus;
slay. but heads up, queen:
This command will not succeed if there are any existing text search dictionaries that use the template.
so if those dictionaries are out there being dependent, you gotta add CASCADE to drop such dictionaries along with the template. that's the move. that's the fix. π₯
π COMPATIBILITY π
ngl this one's short and sweet:
There is no DROP TEXT SEARCH TEMPLATE statement in the SQL standard.
so it's a PostgreSQL original, not a standard-SQL thing. main character energy, honestly π
β SEE ALSO β
go read these next, bestie, they're literally right there:
ALTER TEXT SEARCH TEMPLATE(ALTER_TEXT_SEARCH_TEMPLATE(7))CREATE TEXT SEARCH TEMPLATE(CREATE_TEXT_SEARCH_TEMPLATE(7))
iykyk π
π and that's the page!! footer deets so you know exactly where this came from: PostgreSQL 16.15, dated 2026, for DROP_TEXT_SEARCH_TEMPLATE(7). drink water, back up your databases, and don't drop templates you still need π§π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-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