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/1608~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/1608
Choose a head ref
  • 9 commits
  • 117 files changed
  • 3 contributors

Commits on Apr 29, 2025

  1. Enhancing catalog for support session variables and related support

    This patch introduces new system catalog table pg_variable. This table holds metadata about
    session variables created by command CREATE VARIABLE, and dropped by command DROP VARIABLE.
    Both commands are implemented by this patch. Possibility to change owner, schema or rename.
    
    Access to session variables can be controlled by SELECT or UPDATE rights. Both rights are
    introduced by this patch too.
    
    This patch enhancing pg_dump and psql to support session variables. The changes are related
    to system catalog.
    
    This patch is not short, but the code is simple.
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    ecc03ac View commit details
    Browse the repository at this point in the history
  2. Storage for session variables and SQL interface

    Session variables are stored in session memory in a dedicated hash table.
    They are set by the LET command and read by the SELECT command.
    The access rights should be checked.
    
    The identifiers of session variables should always be shadowed by possible
    column identifiers: we don't want to break an application by creating some
    badly named session variable.
    
    The limits of this patch (solved by other patches):
    
    - session variables block parallel execution
    - session variables blocks simple expression evaluation (in plpgsql)
    - SQL functions with session variables are not inlined
    - CALL statement is not supported (usage of direct access to express executor)
    - EXECUTE statement is not supported (usage of direct access to express executor)
    - memory used by dropped session variables is not released
    
    Implementations of EXPLAIN LET and PREPARE LET statements
    are in separate patches (for better readability)
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    2597c9c View commit details
    Browse the repository at this point in the history
  3. function pg_session_variables for cleaning tests

    This is a function designed for testing and debugging.  It returns the
    content of sessionvars as-is, and can therefore display entries about
    session variables that were dropped but for which this backend didn't
    process the shared invalidations yet.
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    f712ab9 View commit details
    Browse the repository at this point in the history
  4. DISCARD VARIABLES

    Implementation of DISCARD VARIABLES commands by removing hash table with session variables
    and resetting related memory context.
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    00af05b View commit details
    Browse the repository at this point in the history
  5. memory cleaning after DROP VARIABLE

    Accepting a sinval message invalidates entries in the "sessionvars" hash table.
    These entries are validated before any read or write operations on session variables.
    When the entry cannot be validated, it is removed.  Removal will be delayed when
    the variable was dropped by the current transaction, which could still be rolled back.
    laurenz authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    09869a0 View commit details
    Browse the repository at this point in the history
  6. plpgsql tests

    laurenz authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    308fccf View commit details
    Browse the repository at this point in the history
  7. GUC session_variables_ambiguity_warning

    Inside an query the session variables can be shadowed. This behaviour is by design,
    because this ensuring so new variables doesn't break existing queries. But this
    behaviour can be confusing, because shadowing is quiet.
    
    When new GUC session_variables_ambiguity_warning is on, then the warning
    is displayed, when some session variable can be used, but it is not used
    due shadowing. This feature should to help with investigation of unexpected
    behaviour.
    
    Note: PLpgSQL has an option that controls priority of identifier's spaces
    (SQL or PLpgSQL). Default behaviour doesn't allows collisions. I believe
    this default is the best. I cannot to implement similar very strict
    behaviour to session variables, because one unhappy named session variable
    can breaks an applications. The problems related to badly named PLpgSQL's
    varible is limitted just to only one routine.
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    da2b1aa View commit details
    Browse the repository at this point in the history
  8. variable fence syntax support and variable fence usage guard support

    this patch introduces a concept of variable fence - syntax for variable
    reference `VARIABLE(varname)` that is not in collision with column reference.
    When variable fence usage guard warning is active, then usage variable
    without variable fence in the case, where there can be column references,
    the the warning is raised.
    
    initial implementation of variable fence
    [email protected] authored and Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    4792140 View commit details
    Browse the repository at this point in the history
  9. [CF 1608] v20250405 - declarative session variables, LET command

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/1608
    
    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/CAFj8pRAx-Gb9Ux825cxGNm38qQUOrij1GY6erPRaQ=cpqfiX7g@mail.gmail.com
    Author(s): Pavel Stehule
    Commitfest Bot committed Apr 29, 2025
    Configuration menu
    Copy the full SHA
    70930b5 View commit details
    Browse the repository at this point in the history
Loading