PostgreSQL – How to Drop A Column
To drop a column in PostgreSQL, you can use the ALTER TABLE
statement with the DROP COLUMN
clause. Here’s the basic syntax for dropping a column:
ALTER TABLE table_name DROP COLUMN column_name;
where table_name
is the name of the table from which you want to drop the column, and column_name
is the name of the column you want to remove.
Please note that dropping a column is a data-altering operation, and it will permanently remove the column and its data from the table. Make sure to back up your data before executing this operation, especially in a production environment.