CentOS 7 installation of PostgreSQL (RPM mode) and common commands

Official course https://www.postgresql.org/download/linux/redhat/ Installation preparation System version: CentOS Linux release 7.3.1611 (Core) Software version: psql (PostgreSQL) 9.6.17 install 1, Check if PostgreSQL is installed rpm -qa | grep postgres #Check if PostgreSQL is installed rpm ...

Posted on Sun, 16 Feb 2020 22:52:18 -0800 by tripodkid

Personal understanding of postgresql replication slots

os: centos 7.4 postgresql: 9.6.9 replication slots was introduced from postgresql 9.4. It mainly provides an automatic method to ensure that the master computer will not remove all the backup computers before they receive the WAL segments, and the master computer will not remove the rows that may cause recovery conflicts, eve ...

Posted on Fri, 31 Jan 2020 12:34:44 -0800 by donkeychoker

MySQL stress test tool use

1, Mysqlslap: MySQL's own stress testing tool mysql slap is a benchmark tool of mysql. It can query data with simple syntax and is flexible and easy to use. It can simulate multiple clients sending query updates to the server at the same time. It provides performance test data and performance ratio of multiple engines. mysql slap provides intu ...

Posted on Mon, 06 Jan 2020 08:01:44 -0800 by mingo

PostgreSQL state transition

typedef enum DBState { DB_STARTUP = 0, DB_SHUTDOWNED, DB_SHUTDOWNED_IN_RECOVERY, DB_SHUTDOWNING, DB_IN_CRASH_RECOVERY, DB_IN_ARCHIVE_RECOVERY, DB_IN_PRODUCTION } DBState; PostgreSQL includes the above seven statuses during startup, shutdown or operation. In the column of Database cluster state obtained from PG ﹣ contro ...

Posted on Sun, 05 Jan 2020 21:52:51 -0800 by strangesoul

PostGIS Installation Use

1. Installation sudo apt install postgis postgresql-11-postgis-3 Here you need to select the package based on the server version, such as the server is up to 12: sudo apt install postgis postgresql-12-postgis-3 2. Create a database mygis with Postgis functionality Make your OS logon user (mymotif here), a postgers database user, and ha ...

Posted on Sun, 05 Jan 2020 08:27:44 -0800 by alexinjamestown

python connects to postgresql database for CRUD operation

Before executing a python program, make sure that the relevant SQL statements can run normally in postgresql Basic SQL statement Create table create table student(id serial primary key,student_name varchar(20),age int ,class_name varchar(20)); Delete table drop table student; Add data (C-create) insert into student (st ...

Posted on Thu, 02 Jan 2020 20:56:42 -0800 by rayner75

The problem that the user subprocess cannot exit after the postmaster of postgres 9.x is kill ed

scene In the pg9.x database version, after the postmaster process is kill ed, the long connected users will not run differently~~~ Here is an example: postgres=# select version(); version ------------------------------------------------------- ...

Posted on Thu, 02 Jan 2020 18:28:51 -0800 by rami103

Backup and recovery of Postgresql

background As a back-end programmer, it is essential to deal with the database, although the database is handled by a dedicated dba, with little skill.Thus, keep a record of the frequent daily operations of the postgresql database. First, it is convenient to find the time yourself, and also to share with you. Introduction to Commands In additi ...

Posted on Sat, 28 Dec 2019 19:50:53 -0800 by pesoto74

Using PostgreSQL to solve a practical statistical analysis problem

Using PostgreSQL to solve a practical statistical analysis problem Author: old farmer (Liu Qihua) Email: 46715422@qq.com Before, a friend threw me a wonderful demand. Their company had done a batch of questionnaire surveys, all of which were excel documents in a unified format. There were nearly 1300 questionnaire results, all of which were ...

Posted on Thu, 26 Dec 2019 09:00:23 -0800 by cshaul

Data generation of PostgreSQL pgbench tpcb and interpretation of part of SQL source code

Label PostgreSQL , pgbench , tpcb background pgbench is a test tool of PG. the built-in test CASE is tpcb test. At the same time, it supports users to write test cases themselves. Large number of custom CASE references https://github.com/digoal/blog/blob/master/201711/readme.md This paper is the interpretation of tpcb built in pgbench. Sou ...

Posted on Thu, 28 Nov 2019 12:31:48 -0800 by sanlove