DROP_FOREIGN_TABLE(7pg13)

πŸ“¦ version 13.23, in opensuse-leap 16.0

πŸ’… DROP FOREIGN TABLE πŸ’…

okay so bestie, welcome to the DROP FOREIGN TABLE(7) manual page from the PostgreSQL 13.23 documentation. It’s giving β€œremove a foreign table” energy, and honestly? Iconic.

🌸 NAME 🌸

DROP_FOREIGN_TABLE β€” remove a foreign table. periodt.

✨ 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 vibe check, no cap.

πŸ’– PARAMETERS πŸ’–

  • IF EXISTS β€” Do not throw an error if the foreign table does not exist. A notice is issued in this case. so it’s like β€œbestie, I got you” if it’s already gone.
  • name β€” The name (optionally schema-qualified) of the foreign table to drop. 🫢
  • 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). yes, Section 5.14, keep up πŸ’…
  • RESTRICT β€” Refuse to drop the foreign table if any objects depend on it. This is the default. the cautious icon behavior πŸŽ€

🌈 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. slay, but make it standards-adjacent ✨

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’Œ Source/version: PostgreSQL 13.23. Date: 2025. DROP FOREIGN TABLE(7) β€” bye bestie, slay responsibly πŸ’œ

πŸ“¦ where this page comes from