For Ubuntu OS Environment
sudo apt-get install postgresql
Login the postgresql by either one of following command:
-
It will perform OS authentication. It works only if the postgresql is installed in your local machine.
sudo -u postgres psql -f create_db.sql
-
The user account should be superuser of postgresql server. Otherwise you are unlikely to have enough privilege.
psql -h <machine_name> -U <username> -f create_db.sql
psql -h <machine_name> -U dcard_admin -f setup_db.sql dcard_db
psql -h <machine_name> -U dcard_admin -f create_table.sql dcard_db
psql -h <machine_name> -U dcard_admin dcard_db -f create_fk.sql
psql -h <machine_name> -U dcard_admin -f grant_table_privilege.sql dcard_db
psql -h <machine_name> -U dcard_admin -f testing_data.sql dcard_db