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/6212~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/6212
Choose a head ref
  • 2 commits
  • 7 files changed
  • 2 contributors

Commits on Dec 24, 2025

  1. Add pg_get_domain_ddl() function to reconstruct CREATE DOMAIN statements

    This patch introduces a new system function pg_get_domain_ddl() that
    reconstructs the CREATE DOMAIN statement for a given domain. The function
    takes a regtype parameter and returns the complete DDL statement including
    the domain name, base type, default value, and all associated constraints.
    
    The function follows the same pattern as other DDL reconstruction functions
    like pg_get_functiondef() and pg_get_constraintdef(), providing a
    decompiled reconstruction rather than the original command text.
    
    Key features:
    * Supports domains with default values
    * Includes all domain constraints (CHECK, NOT NULL)
    * NOT VALID constraint are handled with an extra ALTER command.
    * Properly quotes identifiers and schema names
    * Handles complex constraint expressions
    * pretty printing support
    * warn against conflicting built-in names
    
    A new documentation section "Get Object DDL Functions" has been created
    to group DDL reconstruction functions, starting with pg_get_domain_ddl().
    This provides a foundation for future DDL functions for other object types.
    
    Comprehensive regression tests are included covering various domain
    configurations.
    
    Reference: PG-151
    Author: Florin Irion <florin.irion@enterprisedb.com>
    Author: Tim Waizenegger <tim.waizenegger@enterprisedb.com>
    Reviewed-by: Álvaro Herrera alvherre@alvh.no-ip.org
    Reviewed-by: jian he <jian.universality@gmail.com>
    Reviewed-by: Chao Li <li.evan.chao@gmail.com>
    Reviewed-by: Neil Chen <carpenter.nail.cz@gmail.com>
    Reviewed-by: Man Zeng <zengman@halodbtech.com>
    irionr authored and Commitfest Bot committed Dec 24, 2025
    Configuration menu
    Copy the full SHA
    dca2b7e View commit details
    Browse the repository at this point in the history
  2. [CF 6212] v5 - pg_get_domain_ddl: DDL reconstruction function for CRE…

    …ATE DOMAIN statement
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/6212
    
    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/5dbba701-c93b-4625-b35b-76d52131535e@gmail.com
    Author(s): Florin Irion, Tim Waizenegger
    Commitfest Bot committed Dec 24, 2025
    Configuration menu
    Copy the full SHA
    cc6a775 View commit details
    Browse the repository at this point in the history
Loading