{"id":34663,"date":"2021-06-09T10:48:34","date_gmt":"2021-06-09T10:48:34","guid":{"rendered":"https:\/\/ittutorial.org\/?p=34663"},"modified":"2021-06-28T12:49:35","modified_gmt":"2021-06-28T12:49:35","slug":"postgresql-single-instace-installations","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/postgresql-single-instace-installations\/","title":{"rendered":"postgresql single instace installations"},"content":{"rendered":"<p>Hello, I will explain how to install postgresql 12 on Centos 7. And how to create postgresql database is explained below.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;-postgresql single instace installations&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>repo package<\/p>\n<p>#yum install centos-release-scl-rh<\/p>\n<p># yum install llvm-toolset-7-clang<\/p>\n<p>**********************************************************************************<\/p>\n<p># yum install -y epel-release<\/p>\n<p># yum install llvm5.0-devel<\/p>\n<p>**********************postgresql software installations**********************************<\/p>\n<p>yum install -y https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm<\/p>\n<p>yum install -y postgresql12-server postgresql12-client postgresql12-contrib postgresql12-devel<\/p>\n<p>&nbsp;<\/p>\n<p>mkdir \/postgres\/data<br \/>\nchown postgres:postgres \/postgres\/data<\/p>\n<p>passwd postgres<br \/>\npostgres<br \/>\npostgres<\/p>\n<p>******************************************************************************<\/p>\n<p>su &#8211; postgres<\/p>\n<p>vi .bash_profile<\/p>\n<p># Get the aliases and functions<br \/>\nif [ -f ~\/.bashrc ]; then<br \/>\n. ~\/.bashrc<br \/>\nfi<\/p>\n<p># User specific environment and startup programs<\/p>\n<p>PATH=$PATH:$HOME\/.local\/bin:$HOME\/bin:$PATH:\/usr\/pgsql-12\/bin\/<br \/>\nexport PGDATA=\/postgres\/data<br \/>\nexport PGUSER=postgres<br \/>\nexport PGDATABASE=postgres<br \/>\nexport PGPORT=5432<br \/>\nexport PGLOCALDIR=\/usr\/pgsql-12\/share\/locale<br \/>\nexport PATH<\/p>\n<p>******************************************************************************<\/p>\n<p>initdb -D \/postgres\/data<\/p>\n<p>pg_ctl status<br \/>\npg_ctl stop<br \/>\npg_ctl start<\/p>\n<p>&nbsp;<\/p>\n<p># DB Version: 12<br \/>\n# OS Type: linux<br \/>\n# DB Type: web<br \/>\n# Total Memory (RAM): 32 GB<br \/>\n# CPUs num: 4<br \/>\n# Connections num: 500<br \/>\n# Data Storage: hdd<\/p>\n<p>listen_addresses = &#8216;*&#8217;<br \/>\nport = 5432<br \/>\nmax_connections = 500<br \/>\nshared_buffers = 8GB<br \/>\neffective_cache_size = 24GB<br \/>\nmaintenance_work_mem = 2GB<br \/>\ncheckpoint_completion_target = 0.7<br \/>\nwal_buffers = 16MB<br \/>\ndefault_statistics_target = 100<br \/>\nrandom_page_cost = 4<br \/>\neffective_io_concurrency = 2<br \/>\nwork_mem = 8388kB<br \/>\nmin_wal_size = 1GB<br \/>\nmax_wal_size = 4GB<br \/>\nmax_worker_processes = 4<br \/>\nmax_parallel_workers_per_gather = 2<br \/>\nmax_parallel_workers = 4<br \/>\nmax_parallel_maintenance_workers = 2<\/p>\n<p>pg_ctl restart<\/p>\n<p>\/postgres\/data\/pg_hba.conf<\/p>\n<p>host all all **************** md5<br \/>\nhost all all **************** md5<br \/>\nhost all all **************** md5<\/p>\n<p>pg_ctl reload<\/p>\n<p>psql<\/p>\n<p>CREATE DATABASE tayfun ENCODING=&#8217;UTF-8&#8242; LC_COLLATE = &#8216;tr_TR.UTF-8&#8242; LC_CTYPE=&#8217;tr_TR.UTF-8&#8217; TEMPLATE template0;<\/p>\n<p>CREATE ROLE testuser PASSWORD &#8216;testuser123!&#8217; SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;<\/p>\n<p>grant connect on database tayfun to testuser with grant option;<\/p>\n<p>alter database tayfun owner to testuser ;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, I will explain how to install postgresql 12 on Centos 7. And how to create postgresql database is explained below. &#8212;&#8212;&#8212;&#8212;&#8212;-postgresql single instace installations&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- repo package #yum install centos-release-scl-rh # yum install llvm-toolset-7-clang ********************************************************************************** # yum install -y epel-release # yum install llvm5.0-devel **********************postgresql software installations********************************** 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 &hellip;<\/p>\n","protected":false},"author":36,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3896],"tags":[2606],"class_list":["post-34663","post","type-post","status-publish","format-standard","","category-postgresql","tag-postgresql"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/34663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=34663"}],"version-history":[{"count":2,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/34663\/revisions"}],"predecessor-version":[{"id":34665,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/34663\/revisions\/34665"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=34663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=34663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=34663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}