Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist
Date
Msg-id 376055.1678373479@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist  ("Salavessa, Joao (Senior Developer)" <Joao.Salavessa@sky.uk>)
Responses RE: [EXTERNAL] Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist
List pgsql-bugs
"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



pgsql-bugs by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently
Next
From: Tom Lane
Date:
Subject: Re: BUG #17827: Rule on insert into table doesn't work when excepting select from the table itself