Setup user/schema in Postgres database?

0
770

Let us see how to setup and create the user and schema in postgres database.

We need to download the postgres database latest stable version from the below link: https://www.postgresql.org/  and install it. 

Using postgres database or by using pgadmin client we can execute the below commands to create user and schema as seen below:-

create user student with password 'student';
grant all on all tables in schema public to student;
grant all on all sequences in schema public to student;
grant all on all functions in schema public to student;

The above commands will create a schema and the and user student successfully as seen below – 

Please make sure to update the pg_hba.conf file under path – under C:\Program Files\PostgreSQL\9.3\data\. Append at the end of the file pg_hba.conf as below:- 

host all all 0.0.0.0/0 trust

We saw how you can easily setup the database through pgadmin client in few minutes. I hope it helps!