I'm compiling this post to create a reference which any postgreSQL-newbie (like myself) can use to get the basic things right !
You need a postgreSQL server up and running before moving further.
sudo apt-get install postgresql1. Update postgres user password.In a terminal run following and give the password when prompted.
sudo -u postgres psql postgres2. Create Database with the name wso2bam. In a terminal run,
\password postgres
sudo -u postgres createdb wso2bam3. Connect to psql- the terminal based frontend,
sudo -u postgres psql postgresafter you run the above command you will get a terminal with postgres=#.
root@thinkPad:~# sudo -u postgres psql postgresNote -: Here onwards I'm going to execute all commands within this psql terminal.
psql (8.4.19)
Type "help" for help.
postgres=#
4. List down databases(similar to MySQL show databases.
\list5. Select database wso2bam.
\c wso2bam6. List tables within wso2bam current database.
\dtIf you are not interested in remembering and typing all these commands, pgAdmin3 might make your life easy. You can install this tool by running,
sudo apt-get install pgadmin3You can use following official documentation to try out basic queries[1].
Please note that I have tested and verified above steps on a Ubuntu 12.10 machine, using both PostgreSQL 8.4 and 9.1 servers.
[1]. http://www.postgresql.org/docs/8.4/static/tutorial-select.html
No comments:
Post a Comment