PostgreSQL – Delete Column
To delete one or more columns of a PostgreSQL table, run the following ALTER TABLE command.
ALTER TABLE tablename DROP COLUMN column_name;
Example 1 – Delete a Column of PostgreSQL Table
Consider the following table. We shall delete the column named percentage.
ADVERTISEMENT
![PostgreSQL Delete Column - Example](https://www.tutorialkart.com/wp-content/uploads/2019/07/postgresql-select-table.png)
Run the following ALTER TABLE query to delete attendance
column from students
table.
ALTER TABLE students DROP COLUMN attendance;
![PostgreSQL Delete Column - ALTER COLUMN DROP](https://www.tutorialkart.com/wp-content/uploads/2019/07/postgresql-delete-column.png)
Let us check the contents of the table using SELECT query, if the column is deleted or not.
![PostgreSQL After dropping column](https://www.tutorialkart.com/wp-content/uploads/2019/07/postgresql-select-from-table.png)
Summary
In this PostgreSQL Tutorial, we have deleted a column from PostgreSQL table. You can repeat the process to delete multiple columns.