I am trying to convert this if statement from SQL Server to Postgres:
IF COL_LENGTH('Flex','revision') IS NOT NULL and OBJECT_ID(N'df_revision', N'D') IS NULL
BEGIN
ALTER TABLE Flex ADD CONSTRAINT df_revision DEFAULT 0 FOR revision
END
The purpose of this query is to set the default on the revision column if the table has that column.