Skip to content

Commit 2a205cb

Browse files
Merge branch 'main' into feat/kinesis-binding-vmware-go-kcl-v2-latest
2 parents d75c04c + 9b3a390 commit 2a205cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

state/postgresql/v2/postgresql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,15 @@ CREATE INDEX ON %[1]s (expires_at);
251251
}
252252
}
253253

254-
// 2) Backfill NULLs deterministically (insertdate, key)
254+
// 2) Backfill NULLs deterministically (created_at, key)
255255
var nulls int64
256256
if err := p.db.QueryRow(ctx, `SELECT COUNT(*) FROM `+fqtnQI+` WHERE row_id IS NULL`).Scan(&nulls); err != nil {
257257
return fmt.Errorf("count NULL row_id: %w", err)
258258
}
259259
if nulls > 0 {
260260
if _, err := p.db.Exec(ctx, `
261261
WITH ranked AS (
262-
SELECT key, ROW_NUMBER() OVER (ORDER BY insertdate ASC, key ASC) AS rn
262+
SELECT key, ROW_NUMBER() OVER (ORDER BY created_at ASC, key ASC) AS rn
263263
FROM `+fqtnQI+`
264264
WHERE row_id IS NULL
265265
)

0 commit comments

Comments
 (0)