Skip to content

Commit

Permalink
Fix external metadata upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 15, 2023
1 parent aa7a05e commit 065e205
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flow/connectors/external_metadata/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ func (p *PostgresMetadataStore) UpdateLastOffset(jobName string, offset int64) e
INSERT INTO `+p.schemaName+`.`+lastSyncStateTableName+` (job_name, last_offset, sync_batch_id)
VALUES ($1, $2, $3)
ON CONFLICT (job_name)
DO UPDATE SET last_offset = GREATEST(last_offset, $2), updated_at = NOW()
DO UPDATE SET last_offset = GREATEST(`+lastSyncStateTableName+`.last_offset, excluded.last_offset),
updated_at = NOW()
`, jobName, offset, 0)

if err != nil {
Expand Down

0 comments on commit 065e205

Please sign in to comment.