PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist

Поиск
Список
Период
Сортировка
От Salavessa, Joao (Senior Developer)
Тема PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist
Дата
Msg-id AM7PR06MB6374BD69EA4C45BAA980BFA0E3B59@AM7PR06MB6374.eurprd06.prod.outlook.com
обсуждение исходный текст
Ответы Re: PostgreSQL 14.7 "ALTER TABLE IF EXISTS" fails - ERROR: schema/relation "" does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

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

 

------------------------------------------

 

ALTER TABLE IF EXISTS dummy.relation DROP CONSTRAINT IF EXISTS dummy  -- running in PostgreSQL 14.7

> ERROR:  schema "dummy" does not exist

 

CREATE SCHEMA dummy  -- running in PostgreSQL 14.7

> OK

 

ALTER TABLE IF EXISTS dummy.relation DROP CONSTRAINT IF EXISTS dummy  -- running in PostgreSQL 14.7

> ERROR:  relation "dummy.relation" does not exist

 

Thanks,

João

Information in this email including any attachments may be privileged, confidential and is intended exclusively for the addressee. The views expressed may not be official policy, but the personal views of the originator. If you have received it in error, please notify the sender by return e-mail and delete it from your system. You should not reproduce, distribute, store, retransmit, use or disclose its contents to anyone. Please note we reserve the right to monitor all e-mail communication through our internal and external networks. SKY and the SKY marks are trademarks of Sky Limited and Sky International AG and are used under licence.

Sky UK Limited (Registration No. 2906991), Sky-In-Home Service Limited (Registration No. 2067075), Sky Subscribers Services Limited (Registration No. 2340150) and Sky CP Limited (Registration No. 9513259) are direct or indirect subsidiaries of Sky Limited (Registration No. 2247735). All of the companies mentioned in this paragraph are incorporated in England and Wales and share the same registered office at Grant Way, Isleworth, Middlesex TW7 5QD

В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently