From 8aee197f278dc4d38b8569f60dbe26b60299ab8b Mon Sep 17 00:00:00 2001 From: Kevin Biju <52661649+heavycrystal@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:31:01 +0530 Subject: [PATCH] [cdc] always initialize childToParentRelIDMapping (#2369) https://github.com/PeerDB-io/peerdb/pull/2323#discussion_r1888186520 --- flow/connectors/postgres/postgres.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/flow/connectors/postgres/postgres.go b/flow/connectors/postgres/postgres.go index 6cd3be11e1..7dcdc3261d 100644 --- a/flow/connectors/postgres/postgres.go +++ b/flow/connectors/postgres/postgres.go @@ -397,13 +397,9 @@ func pullCore[Items model.Items]( if err != nil { return err } - var childToParentRelIDMap map[uint32]uint32 - // only initialize the map if needed, escape hatch because custom publications may not have the right setting - if req.OverridePublicationName != "" || pgVersion < shared.POSTGRES_13 { - childToParentRelIDMap, err = GetChildToParentRelIDMap(ctx, c.conn, slices.Collect(maps.Keys(req.SrcTableIDNameMapping))) - if err != nil { - return fmt.Errorf("error getting child to parent relid map: %w", err) - } + childToParentRelIDMap, err := GetChildToParentRelIDMap(ctx, c.conn, slices.Collect(maps.Keys(req.SrcTableIDNameMapping))) + if err != nil { + return fmt.Errorf("error getting child to parent relid map: %w", err) } if err := c.MaybeStartReplication(ctx, slotName, publicationName, req.LastOffset, pgVersion); err != nil {