[BUG] pg_dump does not properly deal with BEGIN ATOMIC function - Mailing list pgsql-hackers

From Imseih (AWS), Sami
Subject [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Date
Msg-id 2C1933AB-C2F8-499B-9D18-4AC1882256A0@amazon.com
Whole thread Raw
Responses Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
List pgsql-hackers

Hi,

 

What appears to be a pg_dump/pg_restore bug was observed with the new

BEGIN ATOMIC function body syntax introduced in Postgres 14.

 

Dependencies inside a BEGIN ATOMIC function cannot be resolved

if those dependencies are dumped after the function body. The repro

case is when a primary key constraint is used in a ON CONFLICT ON CONSTRAINT

used within the function.

 

With the attached repro, pg_restore fails with

 

pg_restore: error: could not execute query: ERROR:  constraint "a_pkey" for table "a" does not exist

Command was: CREATE FUNCTION public.a_f(c1_in text, c2 integer DEFAULT 60) RETURNS void

 

 

I am not sure if the answer if to dump functions later on in the process.

 

Would appreciate some feedback on this issue.

 

Regards,

 

Sami Imseih

Amazon Web Services (AWS)

 

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: generate syscache info automatically
Next
From: Justin Pryzby
Date:
Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables