Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5667~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5667
Choose a head ref
  • 2 commits
  • 17 files changed
  • 2 contributors

Commits on Aug 3, 2025

  1. index on virtual generated column

    * btree, hash, gist, spgist, gin, brin all are supported
    * Primary key and unique indexes on virtual generated columns are not supported.
    * exclusion constraint on virtual generated columns are not supported, maybe future
    * Expression indexes and partial (predicate) indexes on virtual generated
      columns are currently unsupported.
    * Indexes with included columns cannot use virtual generated columns.
    * An index on a virtual generated column like ``(b INT GENERATED ALWAYS AS (a) VIRTUAL)``
      is effectively equivalent to an index on a.
    * Internally, such indexes are transformed into expression indexes.  For
      example, an index on ``(b INT GENERATED ALWAYS AS (a * 2) VIRTUAL)``
      is internally represented as an expression index on (a * 2).
    * In the pageinspect module, additional tests added for verify the index content
      for virtual generated columns.
    * All index types are supported, including hash and GiST indexes, and
      corresponding regression tests have been added.
    * To support ALTER TABLE ... SET EXPRESSION, the pg_index catalog tracks the
      original attribute number of the virtual generated column, allowing
      identification of indexes that require rebuilding.
    * ALTER COLUMN SET DATA TYPE also triggers a table rewrite; therefore, tracking
      the attribute number of the virtual generated column used by the index is necessary.
    * if the partitioned table and partition both have an index, then the index over the virtual
      generated column should be the same expression. For example, the following last
      command should error out.
        CREATE TABLE parted (b integer,c integer,a integer GENERATED ALWAYS AS (c+1)) PARTITION BY RANGE (b);
        CREATE TABLE part (b integer,c integer,a integer GENERATED ALWAYS AS (c));
        create index on part(a);
        create index on parted(a);
        alter table parted ATTACH partition part for values from (1) to (10);
    
    discussion: https://postgr.es/m/CACJufxGao-cypdNhifHAdt8jHfK6-HX=tRBovBkgRuxw063GaA@mail.gmail.com
    discussion: https://postgr.es/m/CACJufxGgkH0PyyqP6ggqcEWHxZzmkV=puY8ad=s8kisss9MAwg@mail.gmail.com
    commitfest: https://commitfest.postgresql.org/patch/5667
    jianhe-fun authored and Commitfest Bot committed Aug 3, 2025
    Configuration menu
    Copy the full SHA
    a051d28 View commit details
    Browse the repository at this point in the history
  2. [CF 5667] v6 - support create index on virtual generated column.

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5667
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/CACJufxHT-1a-uP9pEq6rpuvq8mS0V0xOHr30R4THsDeo5DyTUA@mail.gmail.com
    Author(s): Jian He
    Commitfest Bot committed Aug 3, 2025
    Configuration menu
    Copy the full SHA
    af7598f View commit details
    Browse the repository at this point in the history
Loading