How to drop column if it exists in PostgreSQL 9+?
<p>I am trying to drop a column from a table. How can I check if the column exists or not?</p>

<p>I went through the documentation at <a href="https://www.postgresql.org/docs/9.2/static/sql-altertable.html" rel="noreferrer">https://www.postgresql.org/docs/9.2/static/sql-altertable.html</a>, but didn't find any example how to do it.</p>

<p>Even found <a href="https://stackoverflow.com/questions/133031/how-to-check-if-a-column-exists-in-sql-server-table">How to check if a column exists in a SQL Server table?</a>, but it does not seem relevant.</p>