1. Home
  2. Docs
  3. Oracle to PostgreSQL Migration
  4. SQL Commands
  5. DROP

DROP

Schema objects (such as views, synonyms, constraints, indexes, functions, procedures) in Oracle database can be either in valid or invalid state. But in PostgreSQL, objects other than indexes do not have any status associated. All objects once compiled are always in valid state.

Oracle and PostgreSQL work quite differently in that respect:

OraclePostgreSQL

In Oracle, you can always drop a table that has views dependent on it. The dependent views become invalid when the referenced table is dropped.

In PostgreSQL, you cannot drop a table that has dependent views. You have to drop the dependent views first and drop the table. Alternately you can specify CASCADE with DROP TABLE statement to drop table with all dependents.

Was this article helpful to you? Yes No

How can we help?