-
Notifications
You must be signed in to change notification settings - Fork 137
feat(roles): add role management to menu and improve security #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Replace string concatenation with format() function in role management scripts to prevent SQL injection with special characters in usernames or passwords. Use %I for identifier quoting and %L for literal escaping. While these scripts are intended for DBA use in interactive sessions, using format() is better practice and handles edge cases with special characters. Files modified: - roles/alter_user_with_random_password.psql - roles/create_user_with_random_password.psql Co-Authored-By: Claude <[email protected]>
62376b0
to
a269478
Compare
- Fix typo: lightweight (was leightweight) in l1 - Use GiB instead of GB in memory prompt per binary units rule
- Spell out abbreviations: DB → database, FKs → Foreign keys, tmp → temporary - Update terminology: master/replica → primary/replica (modern Postgres terminology) - Fix inconsistencies: user name → username, do & undo → do and undo - Remove redundant prefix in v2 description
NikolayS
commented
Sep 30, 2025
NikolayS
commented
Sep 30, 2025
start.psql
Outdated
\echo ' t1 – PostgreSQL parameters tuning' | ||
\echo ' v1 – Vacuum: current activity' | ||
\echo ' v2 – Vacuum: VACUUM progress and autovacuum queue' | ||
\echo ' v2 – Vacuum: vacuum progress and autovacuum queue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think VACUUM here should be uppercase
NikolayS
commented
Sep 30, 2025
NikolayS
commented
Sep 30, 2025
NikolayS
commented
Sep 30, 2025
@@ -1,4 +1,4 @@ | |||
--Vacuum: VACUUM progress and autovacuum queue | |||
--Vacuum: vacuum progress and autovacuum queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VACUUM was fine here
NikolayS
commented
Sep 30, 2025
- Restore postgres_dba_pgvers_17plus and _13plus version checks - Revert VACUUM to uppercase (SQL command) - Revert 'Postgres' terminology (preferred over PostgreSQL) - Revert DO & UNDO to uppercase (migration operations)
This was referenced Sep 30, 2025
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
Enhances role management functionality by adding interactive user creation and password management tools to the main menu, while improving security and overall menu quality.
Changes
New features
These scripts are now accessible from the main
:dba
menu, making secure role management more convenient for DBAs.Security improvements
format()
function in role management scripts%I
for identifier quoting (prevents issues with special characters in usernames)%L
for literal escaping (prevents issues with special characters in passwords)Menu improvements
Infrastructure
Context
The role management scripts were already present in the
roles/
directory but not accessible from the interactive menu. This PR makes them discoverable and usable, while also improving their implementation to handle edge cases with special characters in usernames and passwords.Since these scripts are intended for DBA use in interactive psql sessions where DBAs typically have full database access, the security improvements primarily address edge cases with special characters rather than preventing malicious attacks.