DROP_TEXT_SEARCH_TEMPLATE(7)

โœจ DROP TEXT SEARCH TEMPLATE ๐Ÿ’…

okay bestie, so this page is literally all about DROP TEXT SEARCH TEMPLATE โ€” the PostgreSQL 18.6 command that removes a text search template. that's it, that's the whole vibe. let's get into it ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so DROP TEXT SEARCH TEMPLATE does exactly what it says on the tin โ€” it drops an existing text search template. gone. deleted. no more. ๐Ÿฆ‹

but listen, important part: you must be a superuser to use this command. this is not a regular-user situation, it's giving main character privileges only. ๐Ÿ‘‘


โœจ PARAMETERS โœจ

  • IF EXISTS โ€” do not throw an error if the text search template doesn't exist. instead it just issues a notice, like "hey girl, there was nothing there anyway, no biggie" ๐Ÿ’œ
  • name โ€” the name of an existing text search template. it can be optionally schema-qualified, so you can be extra specific if you want. ๐ŸŽ€
  • CASCADE โ€” automatically drops objects that depend on the text search template, and then in turn all the objects that depend on those objects (see Section 5.15). it's a whole chain reaction, dominoes falling, very dramatic. ๐Ÿ’€
  • RESTRICT โ€” refuses to drop the text search template if any objects depend on it. this is the default, so if you don't say anything, this is what you get. ๐Ÿซถ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

wanna remove the text search template thesaurus? say less:

DROP TEXT SEARCH TEMPLATE thesaurus;
โš ๏ธ heads up bestie: this command will not succeed if there are any existing text search dictionaries that use the template. add CASCADE to drop such dictionaries along with the template. no cap.

โญ COMPATIBILITY โญ

there is no DROP TEXT SEARCH TEMPLATE statement in the SQL standard. so like, it's a PostgreSQL thing, not a universal thing. iykyk. ๐Ÿคทโ€โ™€๏ธ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


and that's the whole page, bestie!! ๐Ÿ’– this was PostgreSQL 18.6 documentation, dated 2026, and yes we are absolutely slaying the text search template cleanup. now go forth and drop responsibly ๐Ÿงšโœจ