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.
Description
This PR brings us the option to configure multiple groups for each user.
This allows us to bring in the configuration of users, which we have done before on the command line.
There seem to be a lot of changes here but it's really just pushing the change of "group -> groups" through.
That said, having this PR first would help: Add "groups" and "comment" to user info #591
User-visible changes
The following commands have been updated:
initialize
-- all users and groups from the configuration are created if requested. This now supports users being in multiple groups.create_users
(or its aliascreate_user
) -- this no longer supports specifying a group or creating a schema for the user. You should specify a user's groups in the configuration file. If you need to create a schema, useupdate_user
.update_user
-- this no longer supports specifying a group or creating a schema for the user. You should specify a user's groups in the configuration file. You can use this command to add a user's schema. If you have added the user's password to your.pgpass
file, then the user's password will be updated.Note that users are now created without passwords and cannot login until you run:
In order to be backwards compatible with current configuration files, both
group
with a single identifier andgroups
with a list oof identifiers is supported to configure a user's groups.Note that
users
is a list in the configuration and you cannot spread the definition of users over multiple files. The last list of users in configuration files wins.Here's an example for user configuration.
Links
Supports: Manage users access and group membership using configuration #581
Testing
You can run all commands using
--dry-run
to make sure that they would do what you want them to do.