When a base table is truncated, the view content will be empty if the view definition query does not contain an aggregate without a GROUP clause. Therefore, such views can be truncated. Aggregate views without a GROUP clause always have one row. Therefore, if a base table is truncated, the view will not be empty and will contain a row with NULL value (or 0 for count()). So, in this case, we refresh the view instead of truncating it. |
||
|---|---|---|
| .. | ||
| create_immv.sql | ||
| pg_ivm.sql | ||
| refresh_immv.sql | ||