Removing Foreign Data Wrappers
This guide explains how to fully remove all foreign data wrappers from your PostgreSQL database.
Components to Remove
When removing a foreign data wrapper, you need to remove several components in the correct order:
- Foreign Tables
- Foreign Servers
- Wrappers Extension
Step-by-Step Removal Process
1. List and Remove Foreign Tables
First, list all foreign tables associated with your wrapper:
1 2 3 4 5 |
|
Remove each foreign table:
1 |
|
2. Remove Foreign Servers
List servers:
1 2 3 4 |
|
Remove each server:
1 |
|
Note
With cascade
option, this will also drop all foreign tables using that foreign server.
3. Remove the Extension
1 |
|
Note
With cascade
option, this will also drop all foreign servers and foreign tables using Wrappers extension.