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
  • 12 commits
  • 59 files changed
  • 2 contributors

Commits on Dec 12, 2025

  1. CREATE VARIABLE, DROP VARIABLE

    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    b914aca View commit details
    Browse the repository at this point in the history
  2. parsing session variable fences

    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)
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    9f24652 View commit details
    Browse the repository at this point in the history
  3. 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 loading variables to
    executed query.
    
    plan
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    4d12f00 View commit details
    Browse the repository at this point in the history
  4. 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).
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    f570305 View commit details
    Browse the repository at this point in the history
  5. svariableReceiver

    allows to store result of the query to session variable
    
    Check correct format of result - one column, one row.
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    36b02d9 View commit details
    Browse the repository at this point in the history
  6. LET command - assign a result of expression to the session variable

    The value is assigned to session variables usually by SET command. Unfortunately
    there are two reasons why SET should not be used for this purpose in Postgres.
    
    1. Using a_expr inside generic_set ram rule produces reduce conflicts, so it needs
       total reimplementation of related gram rules.
    
    2. SET is no plan command - so it doesn't support usage of parameters.
    
    3. Excepting implementation issues, there is fact, so if we use SET command
       for assigning values to session variables, then there can be collisions
       between session variables and GUC, and then we need some concepts, how
       these collisions should be solved, or how to protect self against these
       collisions. With the dedicated command, the collisions between GUC and session
       variables are not possible.
    
    The command LET is executed as usual query execution. The result is stored
    to the target session variable (resultVariable) by using VariableDestReceiver.
    
    Implementations of EXPLAIN LET and PREPARE LET statements are not supported
    now. Postponed to next step due reducing patch size.
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    feabdfc View commit details
    Browse the repository at this point in the history
  7. DISCARD TEMP

    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    e3d3660 View commit details
    Browse the repository at this point in the history
  8. support CREATE IF NOT EXISTS and DROP IF EXISTS

    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    e62ee6a View commit details
    Browse the repository at this point in the history
  9. use names of currently used temp variables for tab complete of DROP V…

    …ARIABLE, LET and VARIABLE()
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    8f80ea8 View commit details
    Browse the repository at this point in the history
  10. transactional DDL - CREATE VARIABLE, DROP VARIABLE

    Generally PostgreSQL DDL statements are transactional. We can implement transactional behave
    for ( CREATE | DROP ) VARIABLE too. Implementation is almost simple. DROP just set dropped_lxid,
    CREATE set created_lxid and moves previous entry of related sessionvars hashtab to stack. At the
    end of transaction for commit we just clean this stack. For rollback we do copy the bootom value
    from the stack and again clean stack.
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    81d0449 View commit details
    Browse the repository at this point in the history
  11. subtransaction support for session variables DDL (CREATE, DROP)

    If we support transactional DDL for CREATE, DROP session  variables, we should to
    support subtransactions too. Implementation is simple. Any value has two new flags:
    created_subid and dropped_subid. At the subtransaction end for rollback we
    clean entries from the stack related to subtransactions. When commit we update
    created_subid and dropped_subid for parent subtransaction.
    okbob@github.com authored and Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    ceef4f1 View commit details
    Browse the repository at this point in the history
  12. [CF 1608] v20251212 - 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/CAFj8pRDoetKkQGqwPtku5hpomPUAvLKihhH6DGmPgVQmaK+UDg@mail.gmail.com
    Author(s): Pavel Stehule
    Commitfest Bot committed Dec 12, 2025
    Configuration menu
    Copy the full SHA
    7997bcd View commit details
    Browse the repository at this point in the history
Loading