#读者注意: This article can choose not to read the explanation, directly execute the code in 0 of each paragraph(0): Some concepts (can skip direct use (i) 0 of the code)1. Client: Psql. PostgreSQL command-line client program that enters the PostgreSQL database at terminal input Psql2. Account: Unlike our commonly used MySQL, the Postgressql database is not required to select a database account, and PostgreSQL uses your current system account as a database account under Unix-like systems.By default,
Use only 500 lines of Python code to implement an English parser tutorial,
The syntax analyzer describes the syntax structure of a sentence to help other applications to reason. Natural Language introduces many unexpected ambiguities, which can be quickly discovered by our understanding of the world. Here is an example that I like very much:
The correct resolution is to connect "with" and "pizza", and the wrong Resolution Associates "with" and "eat:
In the past few years, the natural language
Install PostGIS in the source code of RedHat7
This article describes how to install and use PostGIS in RedHat7 environment.1. PostgreSQL1.1 install PostgreSQL in yum
This is relatively simple and can be directly installed using yum.
$ sudo yum install -y postgresql-server postgresql-devel libxml2 libxml2-devel
By the way, install postgresql-devel and libxml2-devel, which will be used for post compilation and installation of PostGIS.
postgresql.x86_64 9.2.13-1.1postgresql-devel.x86_
source to the APT source list. Create a file in the /etc/apt/source.list.d/ directory pgdg.list with the file content deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main This is the source for Ubuntu 14.04, and other versions of the system can find the relevant source in the document.Then import the signature of the source. $wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - The official source of PostgreSQL is now added to the source list. Next,
initialize the PostgreSQL database:
In CentOS 6.x:
Service postgresql-9.3 initdb
In CentOS 7:
/Usr/pgsql-9.3/bin/postgresql93-setup initdb
Then start the PostgreSQL service and enable it:
In CentOS 6.x:
Service postgresql-9.3 start
Chkconfig postgresql-9.3 on
In CentOS 7:
Systemctl enable postgresql-9.3
Systemctl start postgresql-9.3
2. Adjust Iptables/Firewall
Next, adjust the firewall outbound rules:
In CentOS 6. x:
Vi/etc/sysconfig/iptables
And add the following lines
-A input-m state -- sta
Postgres 9.3 is currently under intensive development. A new feature worth noting in this version is the JSON data type. After reading the new functions for data generation article, let's take a look at the description of the new JSON feature in the commit record:Commit a570c98d7fa0841f17bbf51d62d02d9e493c7fccAuthor: Andrew DunstanDate: Fri Mar 29 14:12:13 2013-0400 Add new JSON processing functions and parser API. The JSON parser is converted into a
initialize the PostgreSQL database:
In CentOS 6.x:
Service postgresql-9.3 initdb
In CentOS 7:
/Usr/pgsql-9.3/bin/postgresql93-setup initdb
Then start the PostgreSQL service and enable it:
In CentOS 6.x:
Service postgresql-9.3 start
Chkconfig postgresql-9.3 on
In CentOS 7:
Systemctl enable postgresql-9.3
Systemctl start postgresql-9.3
2. Adjust Iptables/Firewall
Next, adjust the firewall outbound rules:
In CentOS 6. x:
Vi/etc/sysconfig/iptables
And add the following lines
-A input-m state -- sta
-relational database system that supports the vast majority of SQL structures, such as subqueries, transactions, and user-defined types and functions. "Install PostgreSQL and its associated packages. These related software is required for the PG gem to be installed later, and the PG gem is used to connect PostgreSQL and Ruby on Rails.$ sudo apt-get install PostgreSQL Libpq-devConfigure PostgreSQLOnce installed, use the enhanced security PSQL to configure PostgreSQL. PSQL is a PostgreSQL interact
(Postgres.bki, postgresql.conf.sample, etc.), and check the availability of the files under the path. 4) Set the interrupt signal processing function, the terminal command line SIGHUP, program interrupt SIGINT, program exit Sigquit, software interrupt sigterm and pipeline interruption sigpipe signal such as shielding, to ensure that the initialization of the work smoothly. 5) Create the data directory, and some necessary subdirectories under the directory, such as base, global, BASE/1, etc. 6)
1. Initial state: Master,slave are running states.2. Upgrade processMaster1). Turn off the master record last checkpoint location (latest checkpoint locations), which is where the downtime begins (this is where your downtime starts).The Postgres user executes the following command:$ pg_ctl-d $PGDATA stop-m Fast$ pg_controldata | grep "Latest Checkpoint location"$ Latest Checkpoint location:0/c6198402). Close slave Compare last checkpoint$ pg_ctl-d $PG
After the installation is complete, we need to change the password of Postgres user, otherwise we will not be able to use this database server. Run the Psql command as the Postgres user. Enter the following in the terminal:
sudo su postgres -c psql template1
At this time, a new prompt will appear. Enter the following two commands and replace them with the new pa
already installed).
The default installation location for PostgreSQL is/usr/local/pgsql/, and the system files need 3-10m space. The accompanying test
Try
The program needs about 20M of space to run, so you should pay attention to reserving enough space when installing, suggest/USR/LOCAL/PG
sql/
The catalogue is guaranteed to have more than 50M space. In addition, expand and compile the source program approximately need 30-60m space.
For a multiuser application environment, it is recommended th
sufficient space in the installment, proposed/usr/local/pgsql/directory to guarantee has 50M above space. In addition, expand and compile the source program approximately need 30-60m space.
For a multiuser application environment, it is recommended that you set up a dedicated user name, such as Postgres:
$ su First log in as root
#/usr/sbin/adduser Postgres
In addition, PostgreSQL uses the shared memory me
directory and make the following changes:[Email protected] pg_xlog]$ Tail-2/data/pgsql100/data/pg_hba.conf#host replication postgres:: 1/128 Trusthost replication replica 10.0.0.110/32 MD5As above, this line of configuration means allowing users to replica from10.0.0.110/32A stream replication connection initiated to this database on the network, in short, allows the main library to be connected from the library server to drag the Wal log data. The m
Tags: sql postgreThe CentOS series installation is divided into:
Yum Installation
SOURCE Installation
One, yum installationFollow the official installation documentation.
Install PostgreSQL official Yum repositoryYum Install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
Installing the PostgreSQL databaseYum Install Postgresql96-server Postgresql96-contrib
Initializing and starting the databaseService Postg
First, IntroductionThe purpose of a tablespace is to allow a database administrator to define a location where other non-data directories store database objects. One of the usage scenarios is that if the machine is newly added SSD, but not enough for the entire instance, you can put some important and high frequency tables and indexes on the SSD, improve the query efficiency Second, create TABLE spaceFirst create the directory where you want to save the table space # mkdir-p/export/tablespace1#
Test environment: PostgreSQL 9.3.5,slony-i2.2.3 (Application stack Builder provides) the following reference online tutorials for your own test summary--------------------------------------------------------------------------------------------------------------- --------Main machine: 192.168.19.1 slave: 192.168.19.2(Master and Slave) database name: postgres, user name: Postgres, Password: admin-------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.