DROP_LANGUAGE(7pg15)
π DROP LANGUAGE π
Hey bestie, welcome to the DROP LANGUAGE page β it's from the PostgreSQL 15 docs (you know, the DROP LANGUAGE(7) one), and honestly it's a short one, so grab your iced coffee and let's go β¨
πΈ NAME πΈ
DROP_LANGUAGE β literally just removes a procedural language, that's the whole vibe π
π¦ SYNOPSIS π¦
DROP [ PROCEDURAL ] LANGUAGE [ IF EXISTS ] name [ CASCADE | RESTRICT ]
π DESCRIPTION π
Okay so, DROP LANGUAGE removes the definition of a procedural language that was previously registered. That's it, that's the plot π«Ά
But bestie, listen β there's a gate. You must be a superuser or the owner of the language to run DROP LANGUAGE. No owner energy, no dropping, periodt π
π Note (and this one's important, don't skip it): as of PostgreSQL 9.1, most procedural languages have been made into "extensions", which means you should remove them withDROP EXTENSION, notDROP LANGUAGE. Yes, that's lowkey a plot twist π
β¨ PARAMETERS β¨
IF EXISTSβ do not throw an error if the language doesn't exist. Instead a notice is issued in that case. Like, "girl, that language isn't even here" but politely πnameβ the name of an existing procedural language. The main character of this whole statement πCASCADEβ automatically drop objects that depend on the language (such as functions in the language), and in turn all objects that depend on those objects (see Section 5.14). It's giving domino effect, it's giving "and your cousin too" πRESTRICTβ refuse to drop the language if any objects depend on it. This one is the default, so it's the chill safe option π§
π EXAMPLES π
This command removes the procedural language plsample:
DROP LANGUAGE plsample;
Slay, plsample is gone, we don't know her anymore π
π COMPATIBILITY π
There is no DROP LANGUAGE statement in the SQL standard. So yeah, this is a PostgreSQL original β no cap, that's just how we do it here π
π SEE ALSO π
ALTER LANGUAGE (ALTER_LANGUAGE(7))CREATE LANGUAGE (CREATE_LANGUAGE(7))
Go read those if you want the full saga, bestie π
Mwah π that's the whole page, and it comes to you from PostgreSQL 15.19, dated 2026 β DROP LANGUAGE(7), iconic behavior all around. β
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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