Skip to content

Commit

Permalink
just always init it
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Dec 20, 2024
1 parent dd6a521 commit 5c87b48
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +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)
}
} else {
childToParentRelIDMap = make(map[uint32]uint32)
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 {
Expand Down

0 comments on commit 5c87b48

Please sign in to comment.