From 30ded89530e432c026308c536386cb8c8a4d6774 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 2 Jul 2023 16:13:26 +0000 Subject: [PATCH] Fix query compat with Postgres 13 ...which requires DISTINCT ON to match the start of ORDER BY. --- src/lookup.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lookup.rs b/src/lookup.rs index e3d3ceb..779b253 100644 --- a/src/lookup.rs +++ b/src/lookup.rs @@ -122,7 +122,7 @@ pub(super) async fn fetch_channel_announcements(delta_set: &mut DeltaSet, networ SELECT DISTINCT ON (short_channel_id, direction) short_channel_id, seen FROM channel_updates WHERE short_channel_id = any($1) - ORDER BY seen ASC, short_channel_id ASC, direction ASC + ORDER BY short_channel_id ASC, direction ASC, seen ASC ) AS directional_last_seens ORDER BY short_channel_id ASC, seen DESC ", &[&channel_ids]).await.unwrap(); -- 2.30.2