PostgreSQL error code
PostgreSQL error 2BP01
2BP01 is the SQLSTATE PostgreSQL reports for dependent objects still exist, in class 2B, Dependent Privilege Descriptors Still Exist.
| SQLSTATE | 2BP01 |
|---|---|
| Condition name | dependent_objects_still_exist |
| Class | 2B — Dependent Privilege Descriptors Still Exist |
Reproduce it, then fix it
orders has a foreign key to customers, so dropping customers would leave it pointing at nothing. CASCADE drops that foreign key constraint too, but not the orders table; check the list PostgreSQL prints before you use it. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.
DROP TABLE customers;
DROP TABLE customers CASCADE;