{"id":2921,"date":"2024-03-05T20:03:49","date_gmt":"2024-03-05T17:03:49","guid":{"rendered":"https:\/\/dataera.co\/blog\/2024\/03\/05\/postgresql-kurulumu\/"},"modified":"2025-09-29T12:33:12","modified_gmt":"2025-09-29T09:33:12","slug":"postgresql-installation-on-linux","status":"publish","type":"post","link":"https:\/\/dataera.co\/en\/postgresql-installation-on-linux\/","title":{"rendered":"PostgreSQL Installation on Linux"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2921\" class=\"elementor elementor-2921 elementor-472\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b007832 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"b007832\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wider\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ca21c43 animated-slow elementor-invisible\" data-id=\"ca21c43\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;,&quot;animation&quot;:&quot;fadeInRight&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a2d4efb elementor-widget elementor-widget-menu-anchor\" data-id=\"a2d4efb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"menu-anchor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-menu-anchor\" id=\"images_included\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-af00f98 elementor-section-full_width elementor-reverse-tablet elementor-reverse-mobile elementor-section-height-default elementor-section-height-default\" data-id=\"af00f98\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wider\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-8863bd7\" data-id=\"8863bd7\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-46499f0 elementor-widget elementor-widget-text-editor\" data-id=\"46499f0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div>In this article, we will examine the installation of PostgreSQL, which has attracted attention with its ability to handle large-scale data, has increased its market share in recent years, and is completely open-source, on Linux systems.<\/div><div>We will perform the RPM-based installation for enterprise Linux-based systems such as RedHat\/CentOS\/Scientific. Additionally, we will compile and install it from generic source code.<\/div><div>\u00a0<\/div><div><strong>Installation on RedHat<\/strong><\/div><div>\u00a0<\/div><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/10\/redhat\/rhel-7-x86_64\/pgdg-redhat10-10-2.noarch.rpm\nyum install postgresql10\nyum install postgresql10-server<\/pre><div>The following commands are executed to start Postgres and enable it to start automatically at boot.<\/div><div>\u00a0<\/div><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\/usr\/pgsql-10\/bin\/postgresql-10-setup initdb\nsystemctl enable postgresql-10\nsystemctl start postgresql-10<\/pre><div>Installation is complete; now we can connect.<\/div><div><div>\u00a0<\/div><div>The default port of PostgreSQL is 5432. Let&#8217;s check if it&#8217;s running.<\/div><\/div><div>\u00a0<\/div><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">[root@yesrib ~]# netstat -ntlp |grep 5432\ntcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 17795\/postmaster\ntcp6 0 0 :::5432 :::* LISTEN 17795\/postmaster\nsudo su - postgres\n-bash-4.2$ psql\npsql (10.3)\nType \"help\" for help.<\/pre><div>[sql]postgres=# select version();<\/div><div><p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>PostgreSQL 10.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit<br \/>(1 row)[\/sql]<\/p><div><strong>Installation from Source Code<\/strong><\/div><div>\u00a0<\/div><\/div><div><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">yum install -y readline-devel libtermcap-devel zlib zlib-devel\ntar xvfz postgresql-9.6.6\ncd postgresql-9.6.6\n.\/configure<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">mkdir \/pg966<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">.\/configure --prefix=\/pg966<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">make (make -h 8 ###for 8 core parallizm)\nmake install<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">cd contrib\nmake\nmake install<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">mkdir \/pg966\/data\nchown postgres.postgres \/pg966\/data<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">su - postgres\ninitdb -D \/data -E unicode<\/pre><\/div><div>Success. You can now start the database server using:<\/div><div>\u00a0<\/div><div><strong>Stop\/Start<\/strong><\/div><div>\u00a0<\/div><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">pg_ctl -D \/usr\/local\/pgsql966\/data -l logfile start\npg_ctl stop<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-de039f6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"de039f6\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-29c879e\" data-id=\"29c879e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In this article, we focus on PostgreSQL, a fully open-source database that stands out for its ability to handle large volumes of data and has been increasing its market share in recent years, on Linux &hellip; <a href=\"https:\/\/dataera.co\/en\/postgresql-installation-on-linux\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":2329,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[],"class_list":["post-2921","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-genel-en"],"_links":{"self":[{"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/posts\/2921"}],"collection":[{"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/comments?post=2921"}],"version-history":[{"count":8,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/posts\/2921\/revisions"}],"predecessor-version":[{"id":3035,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/posts\/2921\/revisions\/3035"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/media\/2329"}],"wp:attachment":[{"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/media?parent=2921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/categories?post=2921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dataera.co\/en\/wp-json\/wp\/v2\/tags?post=2921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}