yum安装简化说明:
使用yum安装以下必要组件:
- postgresql-client libraries and client binaries
- postgresql-server core database server
- postgresql-contrib additional supplied modules
- postgresql-devel libraries and headers for C language development
- pgadmin3 – pgAdmin III graphical administration utility
初始化
service postgresql initdb chkconfig postgresql on
fedora18适用,19以上请参看英文说明
Linux downloads (Red Hat family)
The Red Hat family of distributions includes Red Hat Enterprise Linux,CentOS, Fedora, Scientific Linux, Oracle Linux and others.PostgreSQL is available on these platforms by default. However,each version of the platform normally “snapshots” a specific version ofPostgreSQL that is then supported throughout the lifetime of this platform.Since this can often mean a different version than preferred, the PostgreSQLproject provides arepository of packages of allsupported versions for the most common distributions.
Should packages not be available for your distribution, or there areissues with your package manager, there are graphical installers available.
Finally, most Linux systems make it easy to build from source.
Included in distribution
These distributions all include PostgreSQL by default. To installPostgreSQL from these repositories, use theyum command:
yum install postgresql-server
Which version of PostgreSQL you get will depend on the version ofthe distribution:
Distribution | Version |
---|---|
RHEL/CentOS/SL/OL 5 | 8.1 (also supplies package postgresql84) |
RHEL/CentOS/SL/OL 6 | 8.4 |
Fedora 18 | 9.2 |
Fedora 19 | 9.3 |
Fedora 20 | 9.3 |
Other Red Hat family distributions may ship a different version ofPostgreSQL by default, check with your distribution vendor to be sure.
The repository contains many different packages including third partyaddons. The most common and important packages are (substitute theversion number as required):
- postgresql-client libraries and client binaries
- postgresql-server core database server
- postgresql-contrib additional supplied modules
- postgresql-devel libraries and headers for C language development
- pgadmin3 – pgAdmin III graphical administration utility
Post-installation
Due to policies for Red Hat family distributions, the PostgreSQL installationwill not be enabled for automatic start or have the database initializedautomatically. To make your database installation complete, you need toperform these two steps:service postgresql initdb
or, on Fedora 19 and other later derived distributions:
chkconfig postgresql on
postgresql-setup initdb
systemctl enable postgresql.service
PostgreSQL Yum Repository
If the version supplied by your operating system is not the one you want,you can use the PostgreSQL Yum Repository. This repository will integratewith your normal systems and patch management, and provide automaticupdates for all supported versions of PostgreSQL throughout the supportlifetime of PostgreSQL.
The PostgreSQL yum repository currently supports Red Hat Enterprise Linux,CentOS and ScientificLinux versions 5.x and 6.x, as well as current versionsof Fedora. Note that due to the short support cycle on Fedora, all versionsare not available on this platform, and we recommend not using Fedora forserver deployments. All distributions are supported on both x86_64 andi386 architectures.
To use the yum repository, you must first install the repository RPM.To do this, download the correct RPM from therepository RPM listing,and install it with commands like:
yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
Once this is done, you can proceed to install and update packages thesame way as the ones included in the distribution.
yum install postgresql93-server postgresql93-contrib
or, on Fedora 19 and other later derived distributions:
service postgresql-9.3 initdb
chkconfig postgresql-9.3 on
yum install postgresql93-server postgresql93-contrib
/usr/pgsql-9.3/bin/postgresql93-setup initdb
systemctl enable postgresql-9.3.service
systemctl start postgresql-9.3.service
Package names in thePostgreSQL yum repository follows the same standard as the ones includedin the main repositories, but include the version number, such as:
- postgresql93
- postgresql93-server
- postgresql93-contrib
- pgadmin3_93
Direct RPM download
If you cannot, or do not want to, use the yum based installation method,all the RPMs that are in the yum repository are available fordirect downloadand manual installation as well.
Cross distribution packages
Generic RPM and DEB packages that provide a server-only distibutionare avaliable for some 32 and 64-bit Linux distributions. Thesepackages provide a single set of binaries and consistent packagingacross different Linux distributions. They are designed for serverinstallation where a GUI is not available and consistency acrossmultiple distributions is a requirement.
Downloadthe packages from OpenSCG for all supported versions.
Note: The cross distribution packages do not fully integrate withthe platform-specific packaging systems.
Graphical installer
Installers are available for 32 and 64 bit Linux distributionsand include PostgreSQL, pgAdmin and the StackBuilder utility for installationof additional packages. The PostgreSQL 8.4 installers have beentested with a number of Linux distributions and should work on Ubuntu 6.06and above, Fedora 6 and above, CentOS/Red Hat Enterprise Linux 4 and aboveand others. The 9.0 and later installers have only been tested on morerecent distributions.
Downloadthe installer from EnterpriseDB for all supported versions.
Note: The installers do not integrate withplatform-specific packaging systems.
Build from source
The source code can be found in the main file browser.Instructions for building from source can be found in thedocumentation.