The following works in Postgres 9.6 but not in Redshift:
ALTER TABLE stats
ADD COLUMN IF NOT EXISTS panel_exit timestamp;
Can the same functionality be achieved in Redshift?
There is no Amazon Redshift command equivalent to ADD COLUMN IF NOT EXISTS
.
See: ALTER TABLE documentation
To replicate this functionality, your application would first need to query the table metadata and then make the decision whether to issue the ADD COLUMN
command.