Skip to content

Releases: sraoss/pg_ivm

pg_ivm 1.12 (2025-09-04)

04 Sep 14:22
Compare
Choose a tag to compare

What's Changed

New feature

Source Code Improvements

  • Update .gitignore for better portability and consistency with PostgreSQL core by @michaelpq in #147

  • Prefix role names in regression tests with "regress_" to comply with PostgreSQL convention by @michaelpq in #146

Documentation

  • Add missing backtick for REFRESH MATERIALIZED VIEW by @chirpyli in #148

New Contributors

Full Changelog: v1.11...v1.12

pg_ivm 1.11 (2025-05-26)

26 May 07:43
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • Fix maintenance failure with columns whose names include capital letter by @yugo-n in #135

    This bug was introduced in the previous release (v1.10). When a table has a column with a capital letter in its name, incremental view maintenance failed because the column name was parsed as lowercase.

  • Fix build failures on Windows environments by @yuta-masano in #139

    Previously, the lack of PGDLLEXPORT on some functions declarations caused linkage when building with MSVC.

  • Fix potential segmentation fault in create_immv by @yugo-n in #141

    A code issue caused a segmentation fault when building with MSVC, although the problem was not observed on Linux.

Source Code Improvements

Documentation

New Contributors

Full Changelog: v1.10...v1.11

pg_ivm 1.10 (2025-03-11)

11 Mar 14:38
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • Fix a failure in DROP EXTENSION by @ibhaskar2 in #96

    Previously, dropping pg_ivm caused the error "could not open relation with OID ..." due to a hook function that allows DROP TABLE on an IMMV to remove its entry from pg_ivm_immv. Additionally, issuing DROP TABLE concurrently with DROP EXTENSION pg_ivm could result in the same error.

  • Prevent automatic index creation when using set-returning function by @yugo-n in #106

    A unique index was previously created automatically even when a set-returning function appeared in the FROM clause, which led to errors due to key duplication.

  • Change schema from pg_catalog to pgivm by @yugo-n in #116

    Previously, pg_upgrade failed due to permission issues because the pg_ivm_immv catalog was created in pg_catalog. To resolve this, all objects created by pg_ivm have been moved to the pgivm schema, which is now created automatically by pg_ivm.

    Breaking Change: This affects compatibility with previous releases. If you want to access objects like the create_immv function as before, you must either qualify them with the pgivm schema or adjust your search_path accordingly.

  • Fixed view maintenance failures when a column is dropped from a table by @yugo-n in #117

    When a table contained a dropped column, incremental view maintenance failed with an error like:

    ERROR: could not find attribute 43 in subquery targetlist

  • Fix potential view inconsistency issues by @yugo-n in #121

    Previously, the view contents could become inconsistent with the base tables in the following scenarios:

    1. A concurrent transaction modifies a base table and commits before the
      incremental view maintenance starts in the current transaction.

    2. A concurrent transaction modifies a base table and commits before the
      create_immv or refresh_immv command generates data.

    3. Concurrent transactions incrementally update a view with a self-join
      or modify multiple base tables simultaneously.

    These issues have now been resolved to ensure consistency.

Source Code Improvements

  • Drop unused params from ExecCreateImmv function by @reshke in #102
  • Create .gitignore file for excluding any binary/executable files by @reshke in #103
  • Clean duplicated code and some typos by @hyongtao-db in #112

New Contributors

  • @ibhaskar2 made their first contribution in #96
  • @hyongtao-db made their first contribution in #111

Full Changelog: v1.9...v1.10

pg_ivm 1.9 (2024-07-31)

31 Jul 04:11
Compare
Choose a tag to compare

New feature

  • Add support for PostgreSQL 17 by @yugo-n in #92, @thoshiai in #84, and @reshke in #76

    This contains the following changes:

    • Change functions to use a safe search_path during maintenance operations when used with PostgreSQL 17 or later

      This prevents maintenance operations (automatic maintenance of IMMVs and refresh_immv) from performing unsafe access. Functions used by IMMVs that need to reference non-default schemas must specify a search path during function creation.

    • refresh_immv can be executed by users with the MAINTAIN privilege when used with PostgreSQL 17 or later

New Contributors

Full Changelog: v1.8...v1.9

pg_ivm 1.8 (2024-03-01)

01 Mar 14:54
Compare
Choose a tag to compare

Bug fixes

  • Consider tuple duplicity in maintenance of EXISTS views by @yugo-n in #83

    Previously, the duplicity of row was not considered and only one tuple was inserted even when duplicated tuples are generated as a result of inserting a tuple into a table in an EXISTS subquery.

  • Fix checking for expressions containing an EXISTS subquery by @thoshiai in #71

    EXISTS subquery is currently allowed only directly under WHERE clause or in AND expression that is directly under WHERE. However, the check was insufficient previously so that views using expressions other than AND containing an EXISTS subquery could be created without an error and it caused incorrect maintenance results.

  • Check if PgIvmImmvRelationId is invalid before open it by @bytezzz in #78

    Fix an error that occurs at dropping tables that occurs when pg_ivm is installed by shared_preload_libraries without executing CREATE EXTENSION command.

  • Fix an error raised when dropping pg_ivm extension by @yugo-n in d67995c

    Previously, DROP EXTENSION pg_ivm failed due to the failure of opening the index on the pg_ivm_immv catalog table, because the index had been already dropped at that time.

  • Fix typo in README heading by @coox in #81

New Contributors

Full Changelog: v1.7...v1.8

pg_ivm 1.7 (2023-09-13)

13 Sep 02:20
Compare
Choose a tag to compare

New feature

  • Add support for PostgreSQL 16 by @yugo-n in #70

    Now you can build and use pg_ivm with PostgreSQL 13, 14, 15, and 16.

Full Changelog: v1.6...v1.7

pg_ivm 1.6 (2023-08-31)

31 Aug 12:32
Compare
Choose a tag to compare

New feature

  • Add EXISTS clause support in IVM by @thoshiai in #53

    Correlated subqueries using EXISTS in WHERE clause are supported.

    There are following restrictions :

    • EXISTS subqueries are allowed only in WHERE clause.
    • aggregate functions are not supported together with EXISTS.
    • nested EXISTS subqueries in a subquery are not supported.
    • EXISTS condition can use only with AND Expression, OR or NOT is not allowed.

Bug fixes

  • Prohibit types without default btree opclass in the target list by @yugo-n in #67

    Currently, types that does not have an equality operator cannot be used in the target list of the view definition, because all of target list entries are used for comparison to identify rows to be updated or deleted in the view. Previously, an error is raised at the time such view is incrementally maintained, this is fixed to check that at the view creation time.

    This restriction may be relaxed in future after we can use an index to identify rows in the view.

New Contributors

Full Changelog: v1.5.1...v1.6

pg_ivm 1.5.1 (2023-03-02)

02 Mar 06:01
Compare
Choose a tag to compare

This release contains security fixes.

  • Exposure of sensitive information to an unauthorized actor (CWE-200) - CVE-2023-22847
    An Incrementally Maintainable Materialized View (IMMV) created by pg_ivm may reflect rows with Row-Level Security that the owner of the IMMV should not have access to.

  • Uncontrolled search path element (CWE-427) - CVE-2023-23554
    When refreshing an IMMV, pg_ivm executes functions without specifying schema names. Under certain conditions, pg_ivm may be tricked to execute unexpected functions from other schemas with the IMMV owner's privilege.

Bug fixes

  • Fix row level security checks during view maintenance by @yugo-n (CVE-2023-22847)

    The view maintenance is performed under the view owner privilege. If a modified table has a (Row Level Security) RLS policy, rows in that table must be accessed by the privilege of the IMMV owner during view maintenance, so rows invisible to the view owner must not appear in the IMMV. However, the security check was not properly handled, and rows that must not be accessed from the view owner could appear in the view contents when the view was refreshed incrementally during a query that contains multiple types of commands, like a modifying CTE that contains INSERT and UPDATE, or a MERGE command.

  • Fix to use qualified function names during maintenance by @yugo-n (CVE-2023-23554)

    Previously, functions names in pg_catalog schema that were used during view maintenance were not qualified. This is problematic because functions in other schema could be referenced unintentionally. Moreover, that could result in privilege escalation that if a nefarious user who can create a function, arbitrary functions could be executed under IMMV owner's privilege.

  • Rebuild the query for recalculating min/max after search_path change by @yugo-n (CVE-2023-23554)

    Cached plans for recalculating min/max values are built from the view definition query text. Therefore, when the search_path was changed, the query text was analyzed again, and tables or functions in a wrong schema could be referenced in the plan. This is fixed so that, after search_path is changed, a plan is rebuilt from a new query string where table / function names are properly qualified under the latest search_path are used.

Full Changelog: v1.5...v1.5.1

pg_ivm 1.5 (2023-01-30)

30 Jan 13:09
0587e78
Compare
Choose a tag to compare

New feature

  • Add CTE support by @yugo-n in #47

    Simple CTEs (WITH queries) which do not contain aggregates or DISTINCT are supported similarly to simple sub-queries.

Bug fixes

  • Fix automatic index creation on views containing a subquery by @yugo-n in #46

    Previously, a unique index could not be created properly when an IMMV containing a subquery was created even if all primary key attributes appeared in the target list.

  • Fix to allow generate_series in FROM clause by @yugo-n in #50

    Using generate_series caused an error due to an ambiguous reference at the maintenance time because this function is used internally.

  • Prohibit to create IMMVs using subqueries in a function argument or in an expression by @yugo-n in #49

    For example, views like

    • SELECT ... FROM func(..., (SELECT ... FROM ...), ..) ...;
    • SELECT expr(SELECT ... FROM ...) FROM ...;

    cannot be maintained correctly, so they are prohibited.

Full Changelog: v1.4.1...v1.5

v1.4.1

13 Jan 05:22
138eb19
Compare
Choose a tag to compare

This release is for fixing the problem of pg_ivm 1.4 release that the update script pg_ivm--1.3--1.4.sql was not installed.

What's Changed

  • Fix small typos in README by @0xflotus in #44
  • Fix Makefile to install pg_ivm--1.3--1.4.sql by @yugo-n in #45