about 11 years ago
Database creation using PostgreSQL
To start work with postgres, you need to install Postgres. To download PostgreSQL 9.1, go through below link:
To check that you are able to access psql, open cmd and fire command psql. If you are getting error like 'psql' not recognized then add Postgres BIN location into environment path variable ..Program Files\PostgreSQL\9.1\bin
Some time you need to change Method type in "C:\Program Files\PostgreSQL\9.1\data\pg_hba.conf" file. Change MD5 to trust between line number 76 to 86.
1. Before creating database in postgres, you need to create a user/role to access DB. So there some steps to do it.
a. Goto POSTGRES 'bin' directory in CMD
b. Fire this command >> psql -U postgres
c. You see this type "postgres=#"
d. Fire this command >> CREATE USER user_name WITH PASSWORD 'password';
2. Now role/user with name
3. Right click on Database and select create Database option. Write any name and select Owner for it. The user which you created in step 4, same name will be appered into dropdown.
4. Now go to that path location where your DB dump file is located. (E:\dbDump)
5. In command promt, goto dump file location and fire following command "psql -U postgres DATABASE_NAME < DUMP_NAME_WITH_EXTENSION"
Can you help out the community by solving one of the following PostgreSQL problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)