I am trying to drop a column from a table. How can I check if the column exists or not?
I went through the documentation at https://www.postgresql.org/docs/9.2/stati
You just need to add IF EXIST to your DROP COLUMN statement:
IF EXIST
DROP COLUMN
ALTER TABLE tableName DROP COLUMN IF EXISTS columnName;