vendredi 18 mai 2007

Installing PostgreSQL on your Pardus Linux

Let's say that you want to play around with a sql database engine...
I personnaly recommand PostgreSQL, it will satisfy your needs and seems to be the most inovative gpl kid in the database town.
In Pardus installing it is performed by installing the postgresql-server package.
You can optionnally install the kPoGre package which is a kde administration tool for postgreSQL.
To install these, use PiSi of course... you can do it using the command line or the click-o-friendly gui frontend as you prefer ^^
Once you are done downloading and installing, start your postgreSQL engine through the ServiceManager module of TASMA your Pardus Control Center.
Select your PostgreSQL Database Server and start it up...
Now you need to create a role to your username...
For this you need to create your user in postgreSQL, and to achieve that, you have to call createuser from the postgres user.
amine@dan ~ $ su
Password:
dan amine # su postgres
postgres@dan amine $ createuser amine
Shall the new role be a superuser? (y/n) y
CREATE ROLE
Obviously you would have changed amine by your username ^^
Now that you are known by postgreSQL as a superuser, you can come back to your regular being, and create the database you will be using.
To do so, call the createdb command with the database name...
postgres@dan amine $ exit
dan amine # exit
amine@dan ~ $ createdb example
CREATE DATABASE
Now that the database is created, let's play around with it...
You can use kPoGre if you have installed it (for the Gui Lover :-), or give a try to the command line interactive terminal :
amine@dan ~ $ psql -d example
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

example=#
Congratulations, you are ready for playing with your freshly installed fully fledged database engine !
Tip : If you don't like typing psql -d databaseName everytime,  just use your username as databaseName... psql will try that one by default if called without arguments...
Have fun !

Aucun commentaire: