-
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 18, 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 e98985d - Browse repository at this point
Copy the full SHA e98985dView 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 31d6e81 - Browse repository at this point
Copy the full SHA 31d6e81View 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 6bbffd4 - Browse repository at this point
Copy the full SHA 6bbffd4View 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 bd4cbb2 - Browse repository at this point
Copy the full SHA bd4cbb2View 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 3e95df9 - Browse repository at this point
Copy the full SHA 3e95df9View 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 d7481f6 - Browse repository at this point
Copy the full SHA d7481f6View 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 8ce093f - Browse repository at this point
Copy the full SHA 8ce093fView 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 7de03fb - Browse repository at this point
Copy the full SHA 7de03fbView 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 6fb33c6 - Browse repository at this point
Copy the full SHA 6fb33c6View 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 a7d4749 - Browse repository at this point
Copy the full SHA a7d4749View 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 0a51fb3 - Browse repository at this point
Copy the full SHA 0a51fb3View 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 0e21c6b - Browse repository at this point
Copy the full SHA 0e21c6bView 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 da4c557 - Browse repository at this point
Copy the full SHA da4c557View 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 5e03455 - Browse repository at this point
Copy the full SHA 5e03455View 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 4f1c147 - Browse repository at this point
Copy the full SHA 4f1c147View 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 18, 2025 Configuration menu - View commit details
-
Copy full SHA for dfe02a2 - Browse repository at this point
Copy the full SHA dfe02a2View 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