-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/1608~1
head repository: postgresql-cfbot/postgresql
compare: cf/1608
- 16 commits
- 115 files changed
- 3 contributors
Commits on Jun 17, 2025
-
introduce new class (catalog) pg_variable
This table holds metadata about session variables created by command CREATE VARIABLE, and dropped by command DROP VARIABLE.
Configuration menu - View commit details
-
Copy full SHA for c6e4c26 - Browse repository at this point
Copy the full SHA c6e4c26View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for d204c53 - Browse repository at this point
Copy the full SHA d204c53View commit details -
Access to session variables can be controlled by SELECT or UPDATE rights. Both rights are introduced by this patch too. Default ACL are supported.
Configuration menu - View commit details
-
Copy full SHA for be8fdd8 - Browse repository at this point
Copy the full SHA be8fdd8View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for c08020a - Browse repository at this point
Copy the full SHA c08020aView commit details -
support of session variables for pg_dump
This patch enhancing pg_dump to support session variables.
Configuration menu - View commit details
-
Copy full SHA for 7e15553 - Browse repository at this point
Copy the full SHA 7e15553View commit details -
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).
Configuration menu - View commit details
-
Copy full SHA for 69baecb - Browse repository at this point
Copy the full SHA 69baecbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b11fda1 - Browse repository at this point
Copy the full SHA b11fda1View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 223f754 - Browse repository at this point
Copy the full SHA 223f754View commit details -
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).
Configuration menu - View commit details
-
Copy full SHA for 6499cbd - Browse repository at this point
Copy the full SHA 6499cbdView commit details -
allows to store result of the query to session variable Check correct format of result - one column, one row.
Configuration menu - View commit details
-
Copy full SHA for a7d9760 - Browse repository at this point
Copy the full SHA a7d9760View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 7247911 - Browse repository at this point
Copy the full SHA 7247911View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for e90624c - Browse repository at this point
Copy the full SHA e90624cView commit details -
Implementation of DISCARD VARIABLES commands by removing hash table with session variables and resetting related memory context.
Configuration menu - View commit details
-
Copy full SHA for 3c85a69 - Browse repository at this point
Copy the full SHA 3c85a69View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 894256c - Browse repository at this point
Copy the full SHA 894256cView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 9ec514c - Browse repository at this point
Copy the full SHA 9ec514cView commit details -
[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 committedJun 17, 2025 Configuration menu - View commit details
-
Copy full SHA for 403b668 - Browse repository at this point
Copy the full SHA 403b668View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/1608~1...cf/1608