storage: postgres fixes

This commit is contained in:
nkanaev
2026-06-19 23:43:06 +01:00
parent 06bed5b556
commit 72a2bf605b
2 changed files with 5 additions and 5 deletions

View File

@@ -87,10 +87,10 @@ func (s *PostgresStorage) UpdateFeedState(feedID int64, params model.UpdateFeedS
, coalesce($5, '') , coalesce($5, '')
) )
on conflict (feed_id) do update set on conflict (feed_id) do update set
last_refreshed = coalesce($2, last_refreshed), last_refreshed = coalesce($2, feed_states.last_refreshed),
last_error = coalesce($3, last_error), last_error = coalesce($3, feed_states.last_error),
http_lmod = coalesce($4, http_lmod), http_lmod = coalesce($4, feed_states.http_lmod),
http_etag = coalesce($5, http_etag) http_etag = coalesce($5, feed_states.http_etag)
`, `,
feedID, feedID,
params.LastRefreshed, params.LastRefreshed,

View File

@@ -157,7 +157,7 @@ func listQueryPredicate(filter model.ItemFilter, newestFirst bool) (string, []an
args = append(args, filter.Before) args = append(args, filter.Before)
} }
predicate := "1" predicate := "true"
if len(cond) > 0 { if len(cond) > 0 {
predicate = strings.Join(cond, " and ") predicate = strings.Join(cond, " and ")
} }