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
  • 16 commits
  • 115 files changed
  • 3 contributors

Commits on Jun 17, 2025

  1. introduce new class (catalog) pg_variable

    This table holds metadata about session variables created by
    command CREATE VARIABLE, and dropped by command DROP VARIABLE.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    c6e4c26 View commit details
    Browse the repository at this point in the history
  2. CREATE, DROP, ALTER VARIABLE

    Implementation of commands:
    
        CREATE VARIABLE varname AS type
        DROP VARIABLE varname
        ALTER VARIABLE varname OWNER TO
        ALTER VARIABLE varname RENAME TO
        ALTER VARIABLE varname SET SCHEMA
    
    ALTER command uses already prepared infrastructure based on ObjectAddress API,
    so this patch implements ObjectAddress related functionality too.
    
    Event triggers for DDL over session variables are supported.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    d204c53 View commit details
    Browse the repository at this point in the history
  3. GRANT, REVOKE variable

    Access to session variables can be controlled by SELECT or UPDATE rights. Both rights are
    introduced by this patch too. Default ACL are supported.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    be8fdd8 View commit details
    Browse the repository at this point in the history
  4. support of session variables for psql

    This patch enhancing psql to support session variables:
    
     * \dV[+] command
     * tab complete for CREATE, DROP, ALTER VARIABLE
    
    Note: tab complete for variable fencing is not supported yet
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    c08020a View commit details
    Browse the repository at this point in the history
  5. support of session variables for pg_dump

    This patch enhancing pg_dump to support session variables.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    7e15553 View commit details
    Browse the repository at this point in the history
  6. session variable fences parsing

    The session variables can be used in query only inside the variable fence.
    This is special syntax VARIABLE(varname), that eliminates a risk of
    collision between variable and column identifier.
    
    The session variables cannot be used as parameters of CALL or EXECUTE
    commands. These commands evaluates arguments by direct call of expression
    executor, and direct access to session variables from expression executor
    will be implemented later (in next step).
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    69baecb View commit details
    Browse the repository at this point in the history
  7. local HASHTAB for currently used session variables and low level acce…

    …ss functions
    
    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.
    
    Hash entries related to dropped session variables are not released. The memory
    cleaning is implemented in memory-cleaning-after-DROP-VARIABLE patch.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    b11fda1 View commit details
    Browse the repository at this point in the history
  8. collect session variables used in plan and assign paramid

    In the plan stage we need to collect used session variables. On the
    order of this list, the param nodes gets paramid (fix_param_node).
    This number is used (later) as index to buffer of values of the
    used session variables. The buffer is prepared and filled by executor.
    
    Some unsupported optimizations are disabled:
    
    * parallel execution
    * simple expression execution in PL/pgSQL
    * SQL functions inlining
    
    Before execution of query with session variables we need to collect
    used session variables. This list is used for
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    223f754 View commit details
    Browse the repository at this point in the history
  9. fill an auxiliary buffer with values of session variables used in query

    and locks variables used in query. Now we can read the content of any
    session variable. Direct reading from expression executor is not allowed,
    so we cannot to use session variables inside CALL or EXECUTE commands
    (can be supported with direct access to session variables (from expression
    executor) - postponed).
    
    Using session variables blocks parallel query execution. It is not
    technical problem (it just needs a serialization/deserialization of
    es_session_varibles buffer), but it increases a size of patch (and then
    it is postponed).
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    6499cbd View commit details
    Browse the repository at this point in the history
  10. svariableReceiver

    allows to store result of the query to session variable
    
    Check correct format of result - one column, one row.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    a7d9760 View commit details
    Browse the repository at this point in the history
  11. LET command - assign a result of expression to the session variable

    Implementations of EXPLAIN LET and PREPARE LET statements are not supported
    now. Postponed to next step due reducing patch size.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    7247911 View commit details
    Browse the repository at this point in the history
  12. 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 Jun 17, 2025
    Configuration menu
    Copy the full SHA
    e90624c View commit details
    Browse the repository at this point in the history
  13. 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 Jun 17, 2025
    Configuration menu
    Copy the full SHA
    3c85a69 View commit details
    Browse the repository at this point in the history
  14. 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.
    [email protected] authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    894256c View commit details
    Browse the repository at this point in the history
  15. plpgsql tests

    set of plpgsql related tests:
    
    * check session variables and plpgsql variables are not in collision ever
    * check correct plpgsql plan cache invalidation when session variable is dropped
    * check so the value of session variable is not corrupted, when the variable is
      modified inside nested called functions
    laurenz authored and Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    9ec514c View commit details
    Browse the repository at this point in the history
  16. [CF 1608] v20250613 - 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/CAFj8pRDiKxpZA1+dkGK-YW_H8oYp2hVOuFpOPHEkCBc5O4Z_ug@mail.gmail.com
    Author(s): Pavel Stehule
    Commitfest Bot committed Jun 17, 2025
    Configuration menu
    Copy the full SHA
    403b668 View commit details
    Browse the repository at this point in the history
Loading