PostgreSQL94 can be installed using managed by YUM
YUM Installation
PostgreSQL can be installed using RPMs (binary) or SRPMs (source) managed by . This is available for the following Linux distributions (both 32- and 64-bit platforms; for the current release and prior release or two):
- Fedora
- Red Hat Enterprise Linux
- CentOS
- Scientific Linux
- Oracle Enterprise Linux
See links from the main repository, :
Contents[] |
Instructions
Configure your YUM repository
Locate and edit your distributions .repo file, located:
- On Fedora: /etc/yum.repos.d/fedora.repo and /etc/yum.repos.d/fedora-updates.repo, [fedora] sections
- On CentOS: /etc/yum.repos.d/CentOS-Base.repo, [base] and [updates] sections
- On Red Hat: /etc/yum/pluginconf.d/rhnplugin.conf [main] section
To the section(s) identified above, you need to append a line (otherwise dependencies might resolve to the postgresql supplied by the base repository):
exclude=postgresql*
Install PGDG RPM file
A PGDG file is available for each distribution/architecture/database version combination. Browse and find your correct RPM. For example, to install PostgreSQL 9.4 on CentOS 6 64-bit:
yum localinstall
Install PostgreSQL
To list available packages:
yum list postgres*
For example, to install a basic PostgreSQL 9.4 server:
yum install postgresql94-server
Other packages can be installed according to your needs.
Post-installation commands
After installing the packages, a database needs to be initialized and configured.
In the commands below, the value of <name> will vary depending on the version of PostgreSQL used.
For PostgreSQL version 9.0 and above, the <name> includes the major.minor version of PostgreSQL, e.g., postgresql-9.4
For versions 8.x, the <name> is always postgresql (without the version signifier).
Data Directory
The PostgreSQL data directory contains all of the data files for the database. The variable PGDATA is used to reference this directory.
For PostgreSQL version 9.0 and above, the default data directory is:
/var/lib/pgsql/<name>/data
For example:
/var/lib/pgsql/9.4/data
For versions 7.x and 8.x, default data directory is:
/var/lib/pgsql/data/
Initialize
The first command (only needed once) is to initialize the database in PGDATA.
service <name> initdb
E.g. for version 9.4:
service postgresql-9.4 initdb
If the previous command did not work, try directly calling the setup binary, located in a similar naming scheme:
/usr/pgsql-y.x/bin/postgresqlyx-setup initdb
E.g. for version 9.4:
/usr/pgsql-9.4/bin/postgresql94-setup initdb
Startup
If you want PostgreSQL to start automatically when the OS starts:
chkconfig <name> on
E.g. for version 9.4:
chkconfig postgresql-9.4 on
In RHEL 7+, try:
systemctl enable postgresql
Control service
To control the database service, use:
service <name> <command>
where <command> can be:
- start : start the database
- stop : stop the database
- restart : stop/start the database; used to read changes to core configuration files
- reload : reload pg_hba.conf file while keeping database running
E.g. to start version 9.4:
service postgresql-9.4 start
With RHEL 7.1+ and CentOS 7.1+, Systemd is introduced. Use this instead:
systemctl enable postgresql-9.4.service systemctl start postgresql-9.4.service
Removing
To remove everything:
yum erase postgresql94*
Or remove individual packages as desired.
Support
- Email: maintainers@lists.pgrpms.org or pgsql-pkg-yum@postgresql.org (requires subscription)
After installation
in PostgreSQL
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/78156/viewspace-2089223/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Install mysql(5.6) for Using the MySQL Yum RepositoryMySql
- Can't connect to X11 window server usingServer
- Example of SQL Linux Windows Authentication configuration using Managed Service AccountsSQLLinuxWindows
- Can't connect to X11 window server using DISPLAY variableServer
- CentOS7 PostgreSQL94安裝CentOSSQL
- Can't connect to X11 window server using '127.0.0.1:0.0'Server127.0.0.1
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.Server
- java.lang.InternalError: Can't connect to X11 window server using ':0.0' asJavaErrorServer
- Installing MySQL on Linux6 Using the MySQL Yum RepositoryMySqlLinux
- Can you create a second voting disk in a different ASM diskgroup when using External Redundancy in 1ASM
- 4.3.2.2.2 Oracle Managed FilesOracle
- Azure Managed Disk操作
- OMF (Oracle Managed File)Oracle
- Android Studio ERROR: Installed Build Tools revision 34.0.0 is corrupted. Remove and install again using the SDK Manager.AndroidErrorUIREMAI
- Managed Extensibility Framework (MEF)Framework
- oracle-managed files (35)Oracle
- error: externally-managed-environmentError
- RAC資料庫administrator managed管理員管理OR policy managed策略管理資料庫
- Oracle OCP 1Z0 053 Q65(dictionary-managed&local-managed tablespaces)Oracle
- 跨平臺開發 No installed provisioning profiles match the installed iOS signing identitiesiOSIDE
- yum install yum-fastestmirrorAST
- linux 中 yum makecache 、yum update、yum upgrade的作用Linux
- managed-schema 檔案詳解
- Can'tgetKerberosrealmROS
- ftp "CanFTP
- Requested setting INSTALLED_APPSAPP
- yum upgrade和yum update區別
- 修改IP時遇到device not managed by networkmanagerdev
- Connection activation failed: Device not managed by NetworkManagerAIdev
- Creating Managed Today Screen Items
- Using index condition Using indexIndex
- yum命令
- mysql報CanMySql
- CAN協議協議
- CAN_NM
- Oracle Clusterware: Components installed. (Doc ID 556976.1)Oracle
- OPatch failed with error code 73 (These not-installed components)AIError
- How does OUI check if the HACMP software is installed? [ID 738574.1]UIACM