pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: david@buildingfootprintusa.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS
Date: Wed, 29 Nov 2023 11:14:00 -0500
Message-ID: <306769.1701274440@sss.pgh.pa.us> (raw)
In-Reply-To: <18217-c7180ab143091145@postgresql.org>
References: <18217-c7180ab143091145@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I found this issue from running pg_restore with flags to clean and "if 
> exists".  pg_restore returns an error code which is generated from a query
> of the following form:

> ALTER TABLE IF EXISTS ONLY public.foo DROP CONSTRAINT IF EXISTS foo_pkey

This works for me in the current minor release (15.5):

$ psql
psql (15.5)
Type "help" for help.

postgres=# ALTER TABLE IF EXISTS ONLY public.foo DROP CONSTRAINT IF EXISTS foo_pkey;
NOTICE:  relation "foo" does not exist, skipping
ALTER TABLE

Please update.  If you can still reproduce the problem in the
current release, there must be some additional contributing
factor -- please try to provide a self-contained test case.

			regards, tom lane





view thread (2+ messages)

Message-ID: <306769.1701274440@sss.pgh.pa.us>
Permalink:  ../306769.1701274440@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/306769.1701274440@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, david@buildingfootprintusa.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS
  In-Reply-To: <306769.1701274440@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