sql >> Database >  >> RDS >> PostgreSQL

postgresql-installaties met één instantie

Hallo, ik zal uitleggen hoe je postgresql 12 op Centos 7 installeert. En hoe je een postgresql-database maakt, wordt hieronder uitgelegd.

—————-postgresql single instance installaties————————-

repo-pakket

#yum install centos-release-scl-rh

# yum install llvm-toolset-7-clang

********************************************** *******************************

# yum install -y epel-release

# yum install llvm5.0-devel

************************* postgresql software-installaties************************* *******

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum install -y postgresql12-server postgresql12-client postgresql12-contrib postgresql12-devel

mkdir /postgres/data
chown postgres:postgres /postgres/data

passwd postgres
postgres
postgres

********************************************** **************************

su – postgres

vi .bash_profile

# Haal de aliassen en functies op
if [ -f ~/.bashrc ]; dan
. ~/.bashrc
fi

# Gebruikersspecifieke omgeving en opstartprogramma's

PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PATH:/usr/pgsql-12/bin/
export PGDATA=/postgres/data
export PGUSER=postgres
export PGDATABASE=postgres
export PGPORT=5432
export PGLOCALDIR=/usr/pgsql-12/share/locale
export PATH

********************************************** **************************

initdb -D /postgres/data

pg_ctl status
pg_ctl stop
pg_ctl start

# DB-versie:12
# OS-type:linux
# DB-type:web
# Totaal geheugen (RAM):32 GB
# CPU's num:4
# Aantal verbindingen:500
# Gegevensopslag:hdd

listen_addresses ='*'
poort =5432
max_connections =500
shared_buffers =8GB
effectieve_cache_size =24GB
maintenance_work_mem =2GB
checkpoint_completion_target =0,7
wal_buffers =16 MB
default_statistics_target =100
random_page_cost =4
Effective_io_concurrency =2
work_mem =8388kB
min_wal_size =1GB
max_wal_size =4GB
max_worker_processes =4
max_parallel_workers_per_gather =2
max_parallel_workers =4
max_parallel_maintenance_workers =2

pg_ctl herstart

/postgres/data/pg_hba.conf

alles hosten **************** md5
alles hosten **************** md5
alles hosten alle *************** md5

pg_ctl herladen

psql

MAAK DATABASE tayfun ENCODING=’UTF-8′ LC_COLLATE =‘tr_TR.UTF-8′ LC_CTYPE=’tr_TR.UTF-8’ TEMPLATE template0;

CREER ROL testgebruiker PASWOORD ‘testuser123!’ SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

Grant verbinden op database tayfun met testgebruiker met toekenningsoptie;

verander database tayfun eigenaar in testuser;


  1. SQL Server Log Verzending &Disaster Recovery Installatie en configuratie -2

  2. Vervangen in querysyntaxis

  3. PL/pgSQL anoniem codeblok

  4. Is het hebben van een 'OF' in een INNER JOIN-conditie een slecht idee?