Repository navigation
Run ALTER DATABASE SET and apply the stored settings at session start - #440
Merged
Merged
Conversation
tamnd
added a commit
that referenced
this pull request
Oct 20, 2026
* Add the changelog entry for #440 * Run COPY FROM a file of the server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg_regress starts each run with
ALTER DATABASE "regression" SET lc_messages TO 'C'and five more settings. rupg gave "ALTER is not supported yet", so pg_regress stopped before the first test and the pass count was 0 of 239. This PR runsALTER DATABASE ... SETand applies the stored settings when a session of the database starts.Changes
ALTER DATABASE name SET,SET ... FROM CURRENT,SET ... TO DEFAULT,RESET nameandRESET ALLrun asAlterDatabaseSetandAlterSettingdo. The checks ofvalidate_option_array_itemcome first: the name, the context and the value. A new value goes in place of the value of the same parameter, asGUCArrayAdddoes.DROP DATABASEremoves them.databasebefore the values of the startup packet, asprocess_settingsdoes.RESETgoes back to them, andpg_settings.sourceshowsdatabase.pg_db_role_settingshows a row for each database with settings.Known differences
ALTER ROLE ... SETis not supported yet, because rupg has one role.Tests
connection/alter_database_set.testis the output of PostgreSQL 19 for the same script: the errors, the placeholders and the rows ofpg_db_role_setting.database_settingsstarts a session of the database and checks the value, the source andRESET.fmt, clippy, the workspace tests and the checks of xtask pass on server1.