Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) - Mailing list pgsql-hackers

From Damir Belyalov
Subject Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
Date
Msg-id CALH1LguQ5P0uZSYQFy4gJihvV11EkLx+gwxZ-+1DFq1Z6dJqbg@mail.gmail.com
Whole thread Raw
In response to Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)  (torikoshia <torikoshia@oss.nttdata.com>)
Responses Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
List pgsql-hackers
Do you mean you stop dealing with errors concerned with constraints and
triggers and we should review 0006-COPY_IGNORE_ERRORS?
Yes, this patch is simpler and I think it's worth adding it first.
 
Hmm, I applied v6 patch and when canceled COPY by sending SIGINT(ctrl +
C), I faced the same situation as below.
I tested it on CentOS 8.4.
Thank you for pointing out this error. it really needs to be taken into account. In the previous  0006 patch, there were 2 stages in one subtransaction - filling the buffer and 'replay mode' (reading from the buffer). Since only NextCopyFrom() is included in PG_TRY(), and the ERRCODE_QUERY_CANCELED error can occur anywhere, it is impossible to catch it and rollback the subtransaction.

I changed the 0006 patch and fixed this error and now only the 'replay buffer filling' is made in the subtransaction.

Patch 0005 (that processed constraints) needs to be finalized, because it requires subtransactions to rollback constraints, triggers. Therefore, it is not possible to fix it yet. There is a decision to put for(;;) loop in PG_TRY. It will solve the problem, but the code will be too complicated.
Attachment

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Generalize ereport_startup_progress infrastructure
Next
From: Robert Haas
Date:
Subject: Re: Avoid memory leaks during base backups