create or replace function movie_showtimes_refresh_row(
  id integer
) returns void
security definer
language 'plpgsql' as $$
begin
  delete
    from movie_showtimes_with_current_and_sold_out_and_dirty_and_expiry ms
    where ms.id = id;
  insert into movie_showtimes_with_current_and_sold_out_and_dirty_and_expiry
  select *, false, null
    from movie_showtimes_with_current_and_sold_out_unmaterialized ms
    where ms.id = id;
end
$$;
