You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update README with PostgreSQL 18 and role management features
- Update PostgreSQL client installation from version 12 to 18
- Update requirements to reference PostgreSQL 18 as latest
- Add Key Features section documenting r1/r2 role management tools
- Include usage examples and security notes for role management
**You need to have psql version 10 or newer**, but the Postgres server itself can be older – most tools work with it.
25
-
You can install postgresql-client library version, say, 12 on your machine and use it to work with Postgres server version 9.6 and older – in this case postgres_dba will work. But you do need to have psql from the latest (version 12) Postgres release.
25
+
You can install the latest postgresql-client library on your machine and use it to work with older Postgres servers – in this case postgres_dba will work. It's recommended to use psql from PostgreSQL 18 (the latest release) for the best compatibility.
26
26
27
27
On clean Ubuntu, this is how you can get postgresql-client and have the most recent psql:
Using alternative psql pager called "pspg" is highly recommended (but not required): https://github.com/okbob/pspg.
@@ -95,6 +95,36 @@ And then:
95
95
:dba
96
96
```
97
97
98
+
## Key Features
99
+
100
+
### Secure Role Management
101
+
102
+
**postgres_dba** includes interactive tools for secure role (user) management:
103
+
104
+
-**r1** – Create user with random password (interactive)
105
+
-**r2** – Alter user with random password (interactive)
106
+
107
+
These tools help prevent password exposure in psql history, logs, and command-line process lists by:
108
+
- Generating secure random 16-character passwords
109
+
- Using interactive prompts instead of command-line arguments
110
+
- Only displaying the password once at creation/alteration time
111
+
112
+
**Usage example:**
113
+
```sql
114
+
-- In psql, after launching :dba
115
+
-- Select option r1 to create a new user
116
+
-- The script will prompt you for:
117
+
-- - Username
118
+
-- - Superuser privilege (yes/no)
119
+
-- - Login privilege (yes/no)
120
+
-- The generated password will be displayed once in the output
121
+
122
+
-- To see the password, set client_min_messages to DEBUG first:
123
+
set client_min_messages to DEBUG;
124
+
```
125
+
126
+
**Security note:** These are DBA tools designed for trusted environments where the user already has superuser privileges. The password is shown in the psql output, so ensure you're working in a secure session.
127
+
98
128
## How to Extend (Add More Queries)
99
129
You can add your own useful SQL queries and use them from the main menu. Just add your SQL code to `./sql` directory. The filename should start with some 1 or 2-letter code, followed by underscore and some additional arbitrary words. Extension should be `.sql`. Example:
0 commit comments