From 701a87bb316a87c7cd6f60807f659d7a164cea14 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Mon, 11 Mar 2024 22:40:10 +0530 Subject: [PATCH] rename stored proc name --- flow/connectors/postgres/qrep.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flow/connectors/postgres/qrep.go b/flow/connectors/postgres/qrep.go index 918195456..874f9f865 100644 --- a/flow/connectors/postgres/qrep.go +++ b/flow/connectors/postgres/qrep.go @@ -600,7 +600,7 @@ func (c *PostgresConnector) ConsolidateQRepPartitions(ctx context.Context, confi destinationTables := strings.Split(config.DestinationTableIdentifier, ";") constraintsHookExists := true - _, err := c.conn.Exec(ctx, fmt.Sprintf("SELECT '_peerdb_%s_constraints_hook()'::regprocedure", + _, err := c.conn.Exec(ctx, fmt.Sprintf("SELECT '_peerdb_post_run_hook_%s()'::regprocedure", config.FlowJobName)) if err != nil { constraintsHookExists = false @@ -653,14 +653,14 @@ func (c *PostgresConnector) ConsolidateQRepPartitions(ctx context.Context, confi if constraintsHookExists { c.logger.Info("executing constraints hook", slog.String("procName", - fmt.Sprintf("_peerdb_%s_constraints_hook()", config.FlowJobName))) - _, err = tx.Exec(ctx, fmt.Sprintf("CALL _peerdb_%s_constraints_hook()", config.FlowJobName)) + fmt.Sprintf("_peerdb_post_run_hook_%s()", config.FlowJobName))) + _, err = tx.Exec(ctx, fmt.Sprintf("CALL _peerdb_post_run_hook_%s()", config.FlowJobName)) if err != nil { return fmt.Errorf("failed to execute stored procedure for applying constraints: %w", err) } } else { c.logger.Info("no constraints hook found", slog.String("procName", - fmt.Sprintf("_peerdb_%s_constraints_hook()", config.FlowJobName))) + fmt.Sprintf("_peerdb_post_run_hook_%s()", config.FlowJobName))) } err = tx.Commit(ctx)