"Salavessa, Joao (Senior Developer)" <Joao.Salavessa@sky.uk> writes:
> In PostgreSQL 14.7 (AWS RDS) the “IF EXISTS” seems to be ignored for the “ALTER TABLE” statement.
> Example – the query “ALTER TABLE IF EXISTS dummy.relation DROP CONSTRAINT IF EXISTS dummy” (when schema dummy doesn’t
exist,or when schema dummy exists but relation doesn’t) works on 14.6 but fails in 14.7.
> Few outputs below:
> ALTER TABLE IF EXISTS dummy.relation DROP CONSTRAINT IF EXISTS dummy -- running in PostgreSQL 14.6
> NOTICE: relation "relation" does not exist, skipping
> OK
It still works like that for me in 14.latest. Perhaps you installed an
event trigger that is doing something incautious?
regards, tom lane