Posts

Showing posts from July, 2018

PostgreSQL User Administration

PostgreSQL User Administration PostgreSQL has a powerful user authentication and access control system, but for a newcomer, it can seem confusing and overwhelming. In this article I hope to explain how to manage user and permissions with ease. User Administration Adding users There are two ways of adding users in PostgreSQL; the command line  createuser  tool or by using SQL. The command line is the easier of the two methods. Becoming a superuser To add a user you need to use a postgres user with the ability to add users (a superuser). In most cases this will be the postgres user, which is the initial superuser. The simplest way to connect as the postgres user is to change to the postgres unix user on the database server and take advantage of postgres’ ident based authentication, which trusts your unix account. Ident and other connection schemes are explained below. When you add a user you can opt to give the new user two additional powers