Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ Ubuntu 14.04 install PostgreSQL 9.2     - Java-- get the reflection object information (Programming)

- How to deploy Icinga server (Server)

- Learning the Linux powerful network management capabilities (Linux)

- JITwatch installation under Linux (Linux)

- How to Install Foreman under Ubuntu (Server)

- MySQL migration tool used in the production environment (Database)

- Linux serial debugging tools xgcom install (Linux)

- Linux system last command usage (Linux)

- A custom implementation of the Android sidebar (Programming)

- Linux operating system security management skills notes (Linux)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- Ubuntu users to install Gnome-Pie 0.6.5 (Linux)

- ld.so.conf.d profile (Linux)

- JBPM6 Installation and Configuration Tutorial (Linux)

- Android determine the device network connection status, and determine the connection (Programming)

- Ubuntu How to install and upgrade Linux Kernel 3.15 (Linux)

- How to Use Nmap security scanner tool on Linux (Linux)

- Linux platform NTOP Installation and Configuration (Linux)

- C # asynchronous delegates (Programming)

- Simple to install Tor browser to Ubuntu 14.04 and Linux Mint 17 (Linux)

  Ubuntu 14.04 install PostgreSQL 9.2
  Add Date : 2017-04-13      
  First, the environment

VM virtual machine

NAME = "Ubuntu"
VERSION = "12.04.4 LTS, Precise Pangolin"

Second, the process

 1. Install make, now do not install required.

# Apt-get install make

# Make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

This program built for i686-pc-linux-gnu

2. Get the source

But now we have an existing binary installation package, and depending on the method of installation of the system is given. http://www.postgresql.org/download/

Source code on the File Browser, or directly from the version control repository to obtain, is obtained from the git. Operations documentation with source code installed here. http://www.postgresql.org/docs/current/static/installation.html

Open look at the options page ubuntu what some say, http: //www.postgresql.org/download/linux/ubuntu/. A bunch of English probably meant to say Ubuntu already included by default PostgreSQL, now you can use apt-get to install, if pgsql version of Ubuntu you are not on the what you want, you can use PostgreSQL Apt warehouse to integrate the patch, then the following is the basic operation step more Apt related information, see wiki, https: //wiki.postgresql.org/wiki/Apt.

wiki says this team is PGDG support the maintenance of APT repository, they are committed to building PostgreSQL server packages as well as extensions and modules packages on several Debian / Ubuntu releases for all PostgreSQL versions supported. It is to give different distributions released PostgreSQL and related packages. Here is a quick start installation steps, according to wiki better.

3. Install

Add the source, the update source

# Sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $ (lsb_release -cs) -pgdg main"> /etc/apt/sources.list.d/pgdg.list '
# Apt-get update

PS: This variable can get codenames
# Echo $ (lsb_release -cs)
# Cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main

After updating good source, you can search for the various versions of postgresql, probably read, there are 8.2, the latest is 9.5

# Apt-cache search postgresql- | grep 'object-relational' | less
postgresql-9.1 - object-relational SQL database, version 9.1 server
postgresql-8.4 - object-relational SQL database, version 8.4 server
postgresql-8.2 - object-relational SQL database, version 8.2 server
postgresql-8.3 - object-relational SQL database, version 8.3 server
postgresql-9.0 - object-relational SQL database, version 9.0 server
postgresql-9.2 - object-relational SQL database, version 9.2 server
postgresql-9.3 - object-relational SQL database, version 9.3 server
postgresql-9.4 - object-relational SQL database, version 9.4 server
postgresql-9.5 - object-relational SQL database, version 9.5 server

Install wget and certificate update

# Sudo apt-get install wget ca-certificates
... Omitted ...
It is preparing to replace the ca-certificates 20111211 (using ... / ca-certificates_20141019ubuntu0.12.04.1_all.deb) ...
Extracting the file will be used for the replacement package ca-certificates ...
It is preparing to replace wget 1.13.4-2ubuntu1 (using ... / wget_1.13.4-2ubuntu1.2_i386.deb) ...
Extracting the package file to be used for replacement of wget ...
Processing triggers for man-db ...
Processing triggers for install-info ...
We are set ca-certificates (20141019ubuntu0.12.04.1) ...
Updating certificates in / etc / ssl / certs ... 38 added, 17 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
We are set wget (1.13.4-2ubuntu1.2) ...

# Wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

 Install PostgreSQL, being the first to install a 9.2 to practice hand

# Sudo apt-get install postgresql-9.2
Reading package lists ... Done
Building dependency tree package
Reading state information ... Done
The following extra packages will be installed:
  libpq5 pgdg-keyring postgresql-client-9.2 postgresql-client-common postgresql-common ssl-cert
Recommendation installed packages:
  oidentd ident-server locales-all postgresql-doc-9.2 openssl-blacklist
The following NEW packages will be installed:
  libpq5 pgdg-keyring postgresql-9.2 postgresql-client-9.2 postgresql-client-common postgresql-common ssl-cert
0 packages upgraded, 7 newly installed packages, 0 to remove the package, there are 140 packages not upgraded.
4,663 kB need to download packages.
It will consume 22.6 MB additional space after decompression.
...... Omitted download, unzip process
We are set libpq5 (9.4.4-1.pgdg12.4 + 1) ...
We are set pgdg-keyring (2014.1) ...
Removing apt.postgresql.org key from trusted.gpg: OK
Importing apt.postgresql.org key: OK
We are set postgresql-client-common (169.pgdg12.4 + 1) ...
We are set postgresql-client-9.2 (9.2.13-1.pgdg12.4 + 1) ...
update-alternatives: use /usr/share/postgresql/9.2/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz), in automatic mode in.
We are set ssl-cert (1.0.28ubuntu0.1) ...
It is set postgresql-common (169.pgdg12.4 + 1) ...
Adding user postgres to group ssl-cert

Creating config file /etc/postgresql-common/createcluster.conf with new version

Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell / hunspell packages ...
Removing obsolete dictionary files:
 * No PostgreSQL clusters exist; see "man pg_createcluster"
Being set postgresql-9.2 (9.2.13-1.pgdg12.4 + 1) ...
Creating new cluster 9.2 / main ...
  config /etc/postgresql/9.2/main
  data /var/lib/postgresql/9.2/main
  locale zh_CN.UTF-8
  port 5432
update-alternatives: use /usr/share/postgresql/9.2/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz), in automatic mode in.
 * Starting PostgreSQL 9.2 database server [OK]
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

 4. Configure Remote Access

Just installed state after PostgreSQL should be, postgres user password on Ubuntu unknown, postgres password on the database is not set

If using root or allow sudo, you can directly enforce the postgres user login without knowing the password for postgres

root # su postgres
postgres $ psql
psql (9.2.13)
Enter "help" to get help.

postgres = #

(Non-root, allows the user to sudo, there is provided a Free secret) $ sudo -u postgres psql
psql (9.2.13)
Enter "help" to get help.

postgres = #

Once logged in to set up a password of SQL postgres

postgres # \ password postgres

Exit to find a directory, to modify two files, postgresql.conf and pg_hba.conf

# Find / -name postgresql.conf
# Cd /etc/postgresql/9.2/main/
# L
environment pg_ctl.conf pg_hba.conf pg_ident.conf postgresql.conf start.conf

postgresql.conf monitor all IP, the default port, open the log collection, a new log every day, and many do not understand the parameters can be adjusted.

listen_addresses = '*' # what IP address (es) to listen on;
                                        # Comma-separated list of addresses;
                                        # Defaults to 'localhost'; use '*' for all
                                        # (Change requires restart)
port = 5432 # (change requires restart)
logging_collector = on # Enable capturing of stderr and csvlog
                                        # Into log files. Required to be on for
                                        # Csvlogs.
                                        # (Change requires restart)
log_directory = 'pg_log' # directory where log files are written,
                                        # Can be absolute or relative to PGDATA
log_filename = 'postgresql-% Y-% m-% d_% H% M% S.log' # log file name pattern,
                                        # Can include strftime () escapes
log_truncate_on_rotation = off # If on, an existing log file with the
                                        # Same name as the new log file will be
                                        # Truncated rather than appended to.
                                        # But such truncation only occurs on
                                        # Time-driven rotation, not on restarts
                                        # Or size-driven rotation. Default is
                                        # Off, meaning append to existing files
                                        # In all cases.
log_rotation_age = 1d # Automatic rotation of logfiles will
                                        # Happen after that time. 0 disables.
log_rotation_size = 0 # Automatic rotation of logfiles will
                                        # Happen after that much log output.
                                        # 0 disables.

pg_hba.conf join their address, all

# IPv4 local connections:
host all all md5
host all all md5

Postgresql restart the service, and then set about pgAdminIII address, port, user name, password, you can successfully connect
- TCP network communication Java Programming (Programming)
- How do I upgrade to Ubuntu 15.04 (Beta) (Linux)
- Android project and coding specifications (Programming)
- ApacheDS configuration of users and user groups to achieve SSO (Server)
- Linux Security Raiders SSH tools SCP uses examples to explain in detail (Linux)
- NFS-based services and service utilization Corosync DRBD high availability cluster configuration, respectively (Server)
- C ++ pointer two third memory model (Programming)
- CentOS / Linux restart active NIC connection paths / network configure error Error Resolution (Linux)
- Ubuntu 14.04, 13.10 install OpenCV 2.4.9 (Linux)
- Linux system font color change (Linux)
- Report generation CPU, memory, and input and output ports with the sar command (Linux)
- Linux static library generated Guide (Programming)
- ssh port forwarding Comments (Server)
- Oracle DataGuard principles and basic configuration (Database)
- CentOS 6.x and CentOS7 install MPlayer (Linux)
- Elaborate 10-point difference between the new and malloc (Programming)
- Build RPM package uses Docker mirror (Linux)
- MySQL completely uninstall and install Configuring Character Sets under Linux (Database)
- C ++ thread creates transmission parameters are changed (Programming)
- Swift defined type conversion and type aliases (typealias) (Programming)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.