To begin understanding the PostgreSQL fundamentals, first let us introduce the PostgreSQL. This section clarifies about introducing the PostgreSQL on Linux, Windows and Mac OS stages.
Installing PostgreSQL on Linux/Unix
Follow the offered steps to introduce PostgreSQL on your Linux machine. Ensure you are signed in as root before you continue for the establishment.
- Pick the rendition number of PostgreSQL you need and, as precisely as could reasonably be expected, the stage you need from EnterpriseDB
- I downloaded postgresql-9.2.4-1-linux-x64.run for my 64 cycle CentOS-6 machine. Presently, let us execute it as follows −
[root@host]# chmod +x postgresql-9.2.4-1-linux-x64.run
[root@host]# ./postgresql-9.2.4-1-linux-x64.run
------------------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.
------------------------------------------------------------------------
Please specify the directory where PostgreSQL will be installed.
Installation Directory [/opt/PostgreSQL/9.2]:
- When you dispatch the installer, it asks you a couple of fundamental inquiries like area of the establishment, secret phrase of the client who will utilize information base, port number, and so on So keep every one of them at their default esteems aside from secret word, which you can give secret phrase according to your decision. It will introduce PostgreSQL at your Linux machine and will show the accompanying message −
Please wait while Setup installs PostgreSQL on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
-----------------------------------------------------------------------
Setup has finished installing PostgreSQL on your computer.
Follow the accompanying post-establishment steps to make your data set −
[root@host]# su - postgres
Password:
bash-4.1$ createdb testdb
bash-4.1$ psql testdb
psql (8.4.13, server 9.2.4)
test=#
- You can begin/restart postgres worker in the event that it isn't running utilizing the accompanying order −
[root@host]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
In the event that your establishment was right, you will have PotsgreSQL brief test=# as demonstrated previously.
Installing PostgreSQL on Windows
Follow the offered steps to introduce PostgreSQL on your Windows machine. Ensure you host turned Third Gathering Antivirus off while introducing.
- Pick the rendition number of PostgreSQL you need and, as precisely as could reasonably be expected, the stage you need from EnterpriseDB
- I downloaded postgresql-9.2.4-1-windows.exe for my Windows PC running in 32bit mode, so let us run postgresql-9.2.4-1-windows.exe as overseer to introduce PostgreSQL. Select the area where you need to introduce it. As a matter of course, it is introduced inside Program Files organizer.
- The subsequent stage of the establishment cycle is select the registry where your information would be put away. As a matter of course, it is put away under the "information" index.
- Then, the arrangement requests secret key, so you can utilize your #1 secret phrase.
- The following stage; keep the port as default.
- In the following stage, when requested "District", I chose "English, United States".
- A chunk of time must pass to introduce PostgreSQL on your framework. On consummation of the establishment cycle, you will get the accompanying screen. Uncheck the checkbox and snap the Finish button.
After the establishment cycle is finished, you can get to pgAdmin III, StackBuilder and PostgreSQL shell from your Program Menu under PostgreSQL 9.2.
Installing PostgreSQL on Mac
Follow the offered steps to introduce PostgreSQL on your Mac machine. Ensure you are signed in as manager before you continue for the establishment.
- Pick the most recent rendition number of PostgreSQL for Mac OS accessible at EnterpriseDB
- I downloaded postgresql-9.2.4-1-osx.dmg for my Mac OS running with OS X rendition 10.8.3. Presently, let us open the dmg picture in locater and simply double tap it which will give you PostgreSQL installer in the accompanying window −
- Then, click the postgres-9.2.4-1-osx symbol, which will give an admonition message. Acknowledge the admonition and continue for additional establishment. It will request the overseer secret phrase as found in the accompanying window −
- Enter the secret phrase, continue for the establishment, and after this progression, restart your Mac machine. In the event that you don't see the accompanying window, start your establishment by and by.
- When you dispatch the installer, it asks you a couple of essential inquiries like area of the establishment, secret key of the client who will utilize data set, port number and so forth Subsequently, keep every one of them at their default esteems aside from the secret word, which you can give according to your decision. It will introduce PostgreSQL in your Mac machine in the Application envelope which you can check −
- Presently, you can dispatch any of the program to begin with. Allow us to begin with SQL Shell. At the point when you dispatch SQL Shell, simply utilize all the default esteems it shows aside from, enter your secret key, which you had chosen at the hour of establishment. In the case of everything goes fine, at that point you will be inside postgres information base and a postgress# brief will be shown as demonstrated beneath −
Congrats!!! Presently you have your current circumstance prepared to begin with PostgreSQL information base programming.