Skip to content

A simple command-line tool for managing User Privileges in PostgreSQL Database.

License

Notifications You must be signed in to change notification settings

seanmuth/postgresql-user-manager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgresql-user-manager

A command-line interface tool to functionally manage User Privileges for Amazon Redshift or any PostgreSQL Database.

Allow administrator to easily:

+ Manage all user privileges specified in ./config/privileges.cfg file.
+ Transfer all ownership of one User to another.
+ Revoke all privileges of any user and / or Drop the user himself.

Prerequisites

+ Ubuntu (preferably 12.04)

+ GHC 7.6.3 or later

+ Cabal 1.19.2 or later

+ Happy 1.19 or later

Credentials:

+ Credentials files (Located in ./config folder):

    - credentials.cfg: all user credentials that need to be managed
    - db.cfg: PostgreSQL's credentials used by psql command-line tool
    - privileges.cfg: all user privileges.

Clone and build:

Clone the repo:
$ git clone https://github.com/zalora/postgresql-user-manager.git

Build with Docker (remember to configure your credentials first in ./config folder)
$ cd postgresql-user-manager/
$ sudo docker build -t="postgresql-user-manager" .

Executables

(To run with Docker: use docker run postgresql-user-manager as a prefix for the below commands)

Show help
$ .cabal-sandbox/bin/user-privileges-manager --help

To FULLY refresh all user privileges: (including remove all current privileges 
and update with the new privileges)
$ .cabal-sandbox/bin/user-privileges-manager fullupdatemode

To refresh all user privileges:
$ .cabal-sandbox/bin/user-privileges-manager updatemode

To refresh all user privileges on some schemas:
$ .cabal-sandbox/bin/user-privileges-manager updatemode -s %pattern%

To transfer all ownership between 2 users:
$ .cabal-sandbox/bin/user-privileges-manager transfermode user1 user2 -f

To drop a user:
$ .cabal-sandbox/bin/user-privileges-manager dropmode user1 -f

About

A simple command-line tool for managing User Privileges in PostgreSQL Database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 100.0%