-
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
- 9 commits
- 117 files changed
- 3 contributors
Commits on Apr 29, 2025
-
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.
Configuration menu - View commit details
-
Copy full SHA for ecc03ac - Browse repository at this point
Copy the full SHA ecc03acView commit details -
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)
Configuration menu - View commit details
-
Copy full SHA for 2597c9c - Browse repository at this point
Copy the full SHA 2597c9cView 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 f712ab9 - Browse repository at this point
Copy the full SHA f712ab9View 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 00af05b - Browse repository at this point
Copy the full SHA 00af05bView 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 09869a0 - Browse repository at this point
Copy the full SHA 09869a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 308fccf - Browse repository at this point
Copy the full SHA 308fccfView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for da2b1aa - Browse repository at this point
Copy the full SHA da2b1aaView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 4792140 - Browse repository at this point
Copy the full SHA 4792140View commit details -
[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 committedApr 29, 2025 Configuration menu - View commit details
-
Copy full SHA for 70930b5 - Browse repository at this point
Copy the full SHA 70930b5View 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