We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65e4b0b commit 28a86f5Copy full SHA for 28a86f5
kinto/core/storage/postgresql/__init__.py
@@ -252,10 +252,10 @@ def all_resources_timestamps(self, resource_name):
252
WITH existing_timestamps AS (
253
-- Timestamp of latest object by parent_id.
254
(
255
- SELECT DISTINCT ON (parent_id) parent_id, last_modified
+ SELECT parent_id, MAX(last_modified) AS last_modified
256
FROM objects
257
WHERE resource_name = :resource_name
258
- ORDER BY parent_id, last_modified DESC
+ GROUP BY parent_id
259
)
260
-- Timestamp of resources without sub-objects.
261
UNION ALL
0 commit comments