We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d75c04c + 9b3a390 commit 2a205cbCopy full SHA for 2a205cb
state/postgresql/v2/postgresql.go
@@ -251,15 +251,15 @@ CREATE INDEX ON %[1]s (expires_at);
251
}
252
253
254
- // 2) Backfill NULLs deterministically (insertdate, key)
+ // 2) Backfill NULLs deterministically (created_at, key)
255
var nulls int64
256
if err := p.db.QueryRow(ctx, `SELECT COUNT(*) FROM `+fqtnQI+` WHERE row_id IS NULL`).Scan(&nulls); err != nil {
257
return fmt.Errorf("count NULL row_id: %w", err)
258
259
if nulls > 0 {
260
if _, err := p.db.Exec(ctx, `
261
WITH ranked AS (
262
- SELECT key, ROW_NUMBER() OVER (ORDER BY insertdate ASC, key ASC) AS rn
+ SELECT key, ROW_NUMBER() OVER (ORDER BY created_at ASC, key ASC) AS rn
263
FROM `+fqtnQI+`
264
WHERE row_id IS NULL
265
)
0 commit comments