pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS 2+ messages / 2 participants [nested] [flat]
* BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS @ 2023-11-29 14:59 PG Bug reporting form <noreply@postgresql.org> 0 siblings, 1 reply; 2+ messages in thread From: PG Bug reporting form @ 2023-11-29 14:59 UTC (permalink / raw) To: pgsql-bugs@lists.postgresql.org; +Cc: david@buildingfootprintusa.com The following bug has been logged on the website: Bug reference: 18217 Logged by: David Moss Email address: david@buildingfootprintusa.com PostgreSQL version: 15.2 Operating system: PostgreSQL 15.2 on x86_64-pc-linux-gnu Description: 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 In pg_admin this reports: ERROR: relation "public.foo" does not exist SQL state: 42P01 Running this same query in a 15.1 instance returns the expected behavior: NOTICE: relation "foo" does not exist, skipping ALTER TABLE Query returned successfully in 48 msec. More detailed version info: PostgreSQL 15.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit vs. PostgreSQL 15.1, compiled by Visual C++ build 1914, 64-bit ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS @ 2023-11-29 16:14 Tom Lane <tgl@sss.pgh.pa.us> parent: PG Bug reporting form <noreply@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2023-11-29 16:14 UTC (permalink / raw) To: david@buildingfootprintusa.com; +Cc: pgsql-bugs@lists.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 ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-11-29 16:14 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-11-29 14:59 BUG #18217: ALTER TABLE IF EXISTS not being honored with DROP CONSTRAINT IF EXISTS PG Bug reporting form <noreply@postgresql.org> 2023-11-29 16:14 ` Tom Lane <tgl@sss.pgh.pa.us>
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