Skip to content

Commit

Permalink
Change time_for_keys code to use generic no_gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
jhf committed Jun 9, 2024
1 parent e0a2d7e commit 5ca396b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql_saga--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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$,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ca396b

Please sign in to comment.