Saminnet-Search Article Wiki Forum Piwigo SNS Cloud vtiger Sugar
postgres pgadmin

postgres pgadmin

PostgreSQLツis an object-relational database management system (ORDBMS) available for many platforms including Linux, FreeBSD, Solaris, Microsoft Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software.ツPostgreSQL is developed by the PostgreSQL Global Development Group, consisting of a handful of community volunteers employed and supervised by companies such as Red Hat and EnterpriseDB. It implements the majority of the SQL:2008 standard, is ACID-compliant, is fully transactional (including all DDL statements), has extensible data types, operators, and indexes, and has a large number of extensions written by third parties.

The vast majority of Linux distributions have PostgreSQL available in supplied packages. Mac OS X starting with Lion has PostgreSQL server as its standard default database in the server edition and PostgreSQL client tools in the desktop edition.

New features in PostgreSQL 9.1:

PostgreSQLツmoving beyond the traditional relational-database feature set with new, ground-breaking functionality that is unique toツPostgreSQL. The streaming replication feature introduced in release 9.0 is significantly enhanced by adding a synchronous-replication option, streaming backups, and monitoring improvements. Major enhancements include:

  • Allowツsynchronous replication
  • Add support forツforeign tables
  • Add per-columnツcollationツsupport
  • Addツextensionsツwhich simplify packaging of additions toツPostgreSQL
  • Add a trueツseriaizable isolation level
  • Support unlogged tables using theツUNLOGGEDツoption inツCREATE TABLE
  • Allow data-modification commands (INSERT/UPDATE/DELETE) inツWITHツclauses
  • Add nearest-neighbor (order-by-operator) searching toツGiSTツindexes
  • Add aツSECURITY LABELツcommand and support forツSELinuxツpermissions control
  • Update theツPL/Pythonツserver-side language

Here is theツtutorialツaboutツinstallingツPostgreSQL 9.1.3 andツpgAdminツonツCentOS 6ツ/ツRHEL 6.

Open Terminal ( Applications ツ窶> ツSystem Tools ツ窶> Terminal).

Switch to root user.

[raj@geeksite~/]$ su -

Install PosgreSQL 9.1.3:

PostgreSQL publishes rpm packages for all Linux platforms, their packages are generally fresher than those in the other repository. We need to add the repository on our machine by installing repo rpm.

### ツ32 bit ツ###

### ツ64 bit ツ###

CentOS and Redhat repos contains the older version of PostgreSQL packages which will not be required any more, so just exclude the PostgreSQL packages by adding following line in proper sections.

exclude=postgresql*

On CentOS, edit /etc/yum.repos.d/CentOS-Base.repo, [base] and [updates] sections.

On Red Hat, edit edit /etc/yum/pluginconf.d/rhnplugin.conf [main] section

Example ( in CentOSツ/etc/yum.repos.d/CentOS-Base.repo, [base] section):

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
exclude=postgresql*

InstallツPostgreSQLツ9.1.3.

[root@geeksite~/]# yum install postgresql91 postgresql91-server postgresql91-libs postgresql91-contrib postgresql91-devel

Configuring PostgreSQL 9.1.3 server:

Initialize the PostgreSQL.

[root@geeksite~/]# service postgresql-9.1 initdb

PostgreSQL normally listens on the localhosts only, if would you like to enable the PostgreSQL to listen on all ip addresses; edit the /var/lib/pgsql/9.1/data/postgresql.confツ.

[root@geeksite~/]# vi /var/lib/pgsql/9.1/data/postgresql.conf

Go to Connections and Communications section, find the 窶徑isten_address窶 variable. Uncomment the 窶徑isten_addresses窶 and place 窶*窶 instead of 窶徑ocalhost窶

Before editing:

#listen_addresses = "localhost"

After editing:

listen_addresses = "*"

Add your network toツaccessツdatabaseツremotely; Edit /var/lib/pgsql/9.1/data/pg_hba.confツ.

[root@geeksite~/]# vi /var/lib/pgsql/9.1/data/pg_hba.conf

Add the following line according to your network configuration with md5 passwordツauthenticationツ(Enable remote access of database).

# Local networks
host	all	all	     xx.xx.xx.xx/xx	md5
# Example
host	all	all	    192.168.0.0/24	md5
host    all     all         127.0.0.1/32        md5

Restart the PostgreSQL server.

[root@geeksite~/]# service postgresql-9.1 restart

Confirm the PostgreSQL listening.

[root@geekSite ~/]# netstat -ant | grep 5432
tcpツツツツツツツ 0ツツツツツ 0 0.0.0.0:5432ツツツツツツツツツツツ 0.0.0.0:*ツツツツツツツツツツツツツツ LISTEN
tcp6ツツツツツツ 0ツツツツツ 0 :::5432ツツツツツツツツツツツツツツツツ :::*ツツツツツツツツツツツツツツツツツツツ LISTEN

Creating Database:

Login as postgres user.

[root@geeksite~/]$ su -l postgres

create the database called 窶徼est窶

-bash-4.2$ createdb test

Login into the database.

-bash-4.2$ psql test

Create a new user called 窶徨aj窶 to manage the databases.

test=# CREATE USER raj WITH SUPERUSER LOGIN PASSWORD 'raj';

Login with the superuser.

sam@geeksite~/$ psql -h geekdbserver -d test -U raj

Installing pgAdmin:

The command line administration will be good for the people who has full experience on PostgreSQL, but for the beginner pgAdmin will be best option to manage the databases. Install it by issue the following command.

[root@geeksite:~]#  yum install pgadmin3_91

Start pgAdmin3.

[root@geeksite:~]# pgadmin3 or pgadmin3_91

Connect to theツdatabaseツserver using pgAdmin.

Screen shot of theツpgAdminツafter connected to theツPosrgreSQL server.

Now you can manage the databases through theツGUI-administrationツconsole.

That窶冱 all!.

Comments   

 
0 #1 Guest 2017-10-18 13:30
My brother recommended I might like this web site. He was entirely right.

This post truly made my day. You can not imagine just how much time I had spent for this info!
Thanks!

Also visit my web page ... m88 犧壟ク 犧。犧キ犧ュ 犧籾クキ犧ュ
Quote
 

Articles by Date

Category Database

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email