Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create a User on PostgreSQL
#1


    Create a User on PostgreSQL

   

To manage database access and ensure proper data organization, you will need multiple PostgreSQL users. The easiest way to create one is to use the interactive mode. Here are the steps:


   

Switch to the postgres user:


   
sudo su - postgres

   

Run this command to create a new user:


   
createuser --interactive

   

Enter the new PostgresQL account name. For this tutorial, it is TheNewUser.


   

To validate the new role, log in to PostgreSQL with the postgres account:


   
sudo -u postgres psql

   

Check all the users with the following command:


   
\du

   

As shown in the output, the database successfully creates TheNewUser.

   

   

   

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)