DROP_TEXT_SEARCH_CONFIGURATION(7pg18)
โจ 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 ๐
ALTER TEXT SEARCH CONFIGURATION(ALTER_TEXT_SEARCH_CONFIGURATION(7))CREATE TEXT SEARCH CONFIGURATION(CREATE_TEXT_SEARCH_CONFIGURATION(7))
and that's the whole page bestie ๐ this was PostgreSQL 18.6, dated 2026 โ go forth and drop those configurations responsibly, mwah ๐๐
๐ฆ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 ยท PostgreSQL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms