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

Commits on Dec 1, 2025

  1. Add appendStringInfoIdentifier() to avoid intermediate quoting buffers

    Introduce appendStringInfoIdentifier() and
    appendStringInfoQualifiedIdentifier(), helper functions that append an SQL
    identifier directly to a StringInfo while applying quoting rules when
    necessary.  This avoids allocating and copying through temporary palloc
    buffers, as currently happens with quote_identifier() when used together
    with appendStringInfoString().
    
    The new functions improve both readability and efficiency of call sites that
    construct SQL fragments, especially those that need to build qualified
    names such as schema.table.
    
    Convert several existing callers in objectaddress.c, explain.c and
    ruleutils.c to use appendStringInfoIdentifier() /
    appendStringInfoQualifiedIdentifier() as examples.
    
    No functional behavior change is intended.
    
    Author: Chao Li <lic@highgo.com>
    Discussion: https://postgr.es/m/CAEoWx2=g2RVkxXB=JzWphgfg4QGV+spaA3PQ1rBM2iMehrVvjg@mail.gmail.com
    Chao Li (Evan) authored and Commitfest Bot committed Dec 1, 2025
    Configuration menu
    Copy the full SHA
    c21339a View commit details
    Browse the repository at this point in the history
  2. Use appendStringInfoIdentifier() throughout ri_triggers.c

    Replace most uses of quoteOneName() and manual stack buffers in
    ri_triggers.c with appendStringInfoIdentifier() and related infrastructure.
    
    This simplifies the construction of SQL queries generated by RI triggers and
    eliminates the need for MAX_QUOTED_NAME_LEN / stack-allocated intermediate
    buffers.  It also removes several code paths where identifiers were quoted
    manually, making the quoting rules consistent with ruleutils.c and the GUC
    quote_all_identifiers.
    
    This commit also adjusts generate_operator_clause() to support prefixed
    arguments and identifier quoting directly, reducing the number of places
    where callers need to inject string concatenation logic.
    
    No user-visible behavior change is intended; the generated SQL should be
    equivalent to the previous version.
    
    Author: Chao Li <lic@highgo.com>
    Discussion: https://postgr.es/m/CAEoWx2=g2RVkxXB=JzWphgfg4QGV+spaA3PQ1rBM2iMehrVvjg@mail.gmail.com
    Chao Li (Evan) authored and Commitfest Bot committed Dec 1, 2025
    Configuration menu
    Copy the full SHA
    19e6be4 View commit details
    Browse the repository at this point in the history
  3. Remove quoteOneName() and related buffer-sizing macros from ri_trigge…

    …rs.c
    
    After the previous refactoring, quoteOneName() and its callers are no longer
    needed.  Remove the function along with MAX_QUOTED_NAME_LEN,
    MAX_QUOTED_REL_NAME_LEN, and quoteRelationName(), and introduce
    appendRelationName() as the remaining helper for writing qualified relation
    names using appendStringInfoQualifiedIdentifier().
    
    This reduces redundant quoting code and centralizes identifier handling in
    appendStringInfoIdentifier() / appendStringInfoQualifiedIdentifier(), making
    RI triggers consistent with other code that generates SQL fragments.
    
    No functional behavior change is expected.
    
    Author: Chao Li <lic@highgo.com>
    Discussion: https://postgr.es/m/CAEoWx2=g2RVkxXB=JzWphgfg4QGV+spaA3PQ1rBM2iMehrVvjg@mail.gmail.com
    Chao Li (Evan) authored and Commitfest Bot committed Dec 1, 2025
    Configuration menu
    Copy the full SHA
    f06b3e4 View commit details
    Browse the repository at this point in the history
  4. Use appendStringInfoIdentifier() in more places.

    Chao Li (Evan) authored and Commitfest Bot committed Dec 1, 2025
    Configuration menu
    Copy the full SHA
    cd750b2 View commit details
    Browse the repository at this point in the history
  5. [CF 6240] v4 - quoteOneName() inconsistency with quote_all_identifier…

    …s — replacement API proposed: appendStringInfoIdentifier
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/6240
    
    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/CAEoWx2m0v=n2CgonU3Tz1GOj1=dFWu9YcBPc6v-pJi2LYxG9Zw@mail.gmail.com
    Author(s): Chao Li
    Commitfest Bot committed Dec 1, 2025
    Configuration menu
    Copy the full SHA
    f19359a View commit details
    Browse the repository at this point in the history
Loading