DROP_TEXT_SEARCH_CONFIGURATION(7)

โœจ DROP_TEXT_SEARCH_CONFIGURATION โœจ

okay bestie, we're deep in the PostgreSQL 18.6 Documentation today and this one is literally about yeeting a text search configuration out of existence ๐Ÿ’… it's giving "cleanup era" fr fr


๐ŸŒธ NAME ๐ŸŒธ

DROP_TEXT_SEARCH_CONFIGURATION โ€” remove a text search configuration ๐Ÿ—‘๏ธโœจ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

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

๐Ÿ’– DESCRIPTION ๐Ÿ’–

So DROP TEXT SEARCH CONFIGURATION drops an existing text search configuration. That's it, that's the whole vibe. ๐Ÿ’€

But โ€” and this is the important part, no cap โ€” to run this command you must be the owner of the configuration. Not your friend, not your coworker, you. The database does not care about your excuses ๐Ÿซถ


๐Ÿฆ‹ PARAMETERS ๐Ÿฆ‹

  • IF EXISTS โ€” do not throw an error if the text search configuration doesn't exist. Instead, a notice is issued in this case. So like, no dramatic meltdown, just a lil "hey btw it's not there" ๐Ÿฅฒ
  • name โ€” the name (optionally schema-qualified) of an existing text search configuration. Yes you can slide the schema in there if you need to, main character energy ๐ŸŽ€
  • CASCADE โ€” automatically drop objects that depend on the text search configuration, and in turn all objects that depend on those objects (see Section 5.15). It's giving domino effect, it's giving chain reaction ๐Ÿ”ฅ
  • RESTRICT โ€” refuse to drop the text search configuration if any objects depend on it. This is the default. She's cautious, she's responsible, she said "nope not on my watch" ๐Ÿงš

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Remove the text search configuration my_english:

DROP TEXT SEARCH CONFIGURATION my_english;

And now the plot twist ๐Ÿ˜ญ โ€” this command will not succeed if there are any existing indexes that reference the configuration in to_tsvector calls. Add CASCADE to drop such indexes along with the text search configuration. So if it's refusing to cooperate, that's why, and now you know iykyk โœจ


โญ COMPATIBILITY โญ

There is no DROP TEXT SEARCH CONFIGURATION statement in the SQL standard. PostgreSQL said "we're doing our own thing" and honestly? iconic ๐Ÿ‘‘


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


and that's the whole page bestie ๐Ÿ’œ this was PostgreSQL 18.6, dated 2026 โ€” go forth and drop those configurations responsibly, mwah ๐Ÿ“๐Ÿ’–