Bug #34779
closedContent View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2070535
Description of problem:
Content View publish fails with error PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
Version-Release number of selected component (if applicable):
6.10
How reproducible:
Customer Environment
Steps to Reproduce:
1. Create a content view using the below repository
~~
1) Id: 1
Name: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server
2) Id: 9
Name: Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_-_RH_Common_RPMs_x86_64_7Server
3) Id: 7
Name: Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7Server
Label: Red_Hat_Enterprise_Linux_7_Server_-_Optional_RPMs_x86_64_7Server
4) Id: 6
Name: Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64
Label: Red_Hat_Enterprise_Linux_7_Server_-_Extras_RPMs_x86_64
5) Id: 4
Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server
Label: Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server
~~
2. Publish the content view and it will fail with the error "ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time".
Actual results:
Following error while publishing content view
Error:
PG::CardinalityViolation: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
Expected results:
Content view should be published without error.
Additional info: