Skip to content

Commit

Permalink
Only REFRESH CONCURRENTLY if view populated?
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Feb 28, 2024
1 parent d0f2052 commit dfcbab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scenic/adapters/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def refresh_materialized_view(name, concurrently: false, cascade: false)
refresh_dependencies_for(name, concurrently: concurrently)
end

if concurrently
if concurrently && populated?(name)
raise_unless_concurrent_refresh_supported
execute "REFRESH MATERIALIZED VIEW CONCURRENTLY #{quote_table_name(name)};"
else
Expand Down

0 comments on commit dfcbab3

Please sign in to comment.