From 5ca396b417a76e133712bb9ccd722733596ced29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20H=2E=20Fjeld?= Date: Sat, 8 Jun 2024 22:42:35 -1000 Subject: [PATCH] Change time_for_keys code to use generic no_gaps --- sql_saga--1.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql_saga--1.0.sql b/sql_saga--1.0.sql index f242015..f787e5b 100644 --- a/sql_saga--1.0.sql +++ b/sql_saga--1.0.sql @@ -3537,7 +3537,7 @@ BEGIN IF fk_val IS NULL THEN RETURN true; END IF; EXECUTE format($q$ - SELECT completely_covers(%1$s.%3$s, $2 ORDER BY %1$s.%3$s) + SELECT no_gaps(%1$s.%3$s, $2 ORDER BY %1$s.%3$s) FROM %1$s WHERE %1$s.%2$s = $1 $q$, @@ -3679,7 +3679,7 @@ BEGIN LEFT OUTER JOIN ONLY %4$s ON %4$s.%5$s = %7$s.fk GROUP BY %7$s.fk, %7$s.valid_at - HAVING NOT COALESCE(completely_covers(%4$s.%6$s, %7$s.valid_at ORDER BY %4$s.%6$s), false) + HAVING NOT COALESCE(no_gaps(%4$s.%6$s, %7$s.valid_at ORDER BY %4$s.%6$s), false) ) $q$, from_table, fk_column, from_range_column, to_table, pk_column, to_range_column, tmp_table) USING old_pk_val, old_pk_range