DROP_FOREIGN_TABLE(7pg15)
π NAME π
okay so this is the DROP_FOREIGN_TABLE(7pg15) page from the PostgreSQL 15.19 Documentation, and it is literally all about DROP FOREIGN TABLE β the command that removes a foreign table. bestie, only the owner of a foreign table can remove it. no cap. β¨
π¦ SYNOPSIS π¦
DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
πΈ DESCRIPTION πΈ
DROP FOREIGN TABLE removes a foreign table. Only the owner of a foreign table can remove it. that's the whole vibe check π
π PARAMETERS π
IF EXISTSβ do not throw an error if the foreign table does not exist. a notice is issued in this case, so it still lets you know what's up πnameβ the name of the foreign table to drop, optionally schema-qualified. yes bestie, you can be extra specific πCASCADEβ automatically drop objects that depend on the foreign table (such as views), and in turn all objects that depend on those objects (see Section 5.14). it's giving chain reaction π₯RESTRICTβ refuse to drop the foreign table if any objects depend on it. this is the default, so it's the safe lil default vibe π«Ά
π EXAMPLES π
to destroy two foreign tables, films and distributors:
DROP FOREIGN TABLE films, distributors;
π COMPATIBILITY π
this command conforms to ISO/IEC 9075-9 (SQL/MED), except that the standard only allows one foreign table to be dropped per command, and apart from the IF EXISTS option, which is a PostgreSQL extension. so yeah, mostly standard with a lil PostgreSQL flourish β¨
π SEE ALSO π
ALTER FOREIGN TABLE (ALTER_FOREIGN_TABLE(7))CREATE FOREIGN TABLE (CREATE_FOREIGN_TABLE(7))
mwah π this cutie is PostgreSQL 15.19, dated 2026, and the page is DROP FOREIGN TABLE(7). periodt. π
π¦ 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