Postgresql alter table migration

broken image
broken image

PostgreSQL doesn’t support marking table columns as unused. ALTER TABLE EMPLOYEES DROP UNUSED COLUMNS įor more information, see CREATE TABLE in the Oracle documentation. SELECT * FROM USER_UNUSED_COL_TABS ĭrop the column permanently (physically drop the column).

broken image

To set a column as unused, use the SET UNUSED clause.Įxamples ALTER TABLE EMPLOYEES SET UNUSED (COMMISSION_PCT) ĪLTER TABLE EMPLOYEES SET UNUSED (JOB_ID, COMMISSION_PCT) ĭisplay unused columns. To overcome this issue, a column can be marked as unused and then be physically dropped later. The main advantage of setting a column to UNUSED is to reduce possible high database load when dropping a column from a large table. Select statements don’t retrieve data from columns marked as unused and aren’t displayed when running a DESCRIBE table command. Unused columns aren’t physically dropped, but are treated as if they were dropped. Oracle provides a method to mark columns as unused. PostgreSQL doesn’t support unused columns.

broken image