pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Salavessa, Joao (Senior Developer) <Joao.Salavessa@sky.uk>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "<name>" does not exist
Date: Thu, 09 Mar 2023 09:51:19 -0500
Message-ID: <376055.1678373479@sss.pgh.pa.us> (raw)
In-Reply-To: <AM7PR06MB6374BD69EA4C45BAA980BFA0E3B59@AM7PR06MB6374.eurprd06.prod.outlook.com>
References: <AM7PR06MB6374BD69EA4C45BAA980BFA0E3B59@AM7PR06MB6374.eurprd06.prod.outlook.com>

"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





view thread (3+ messages)  latest in thread

Message-ID: <376055.1678373479@sss.pgh.pa.us>
Permalink:  ../376055.1678373479@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/376055.1678373479@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Joao.Salavessa@sky.uk, pgsql-bugs@lists.postgresql.org
  Subject: Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "<name>" does not exist
  In-Reply-To: <376055.1678373479@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox