{"id":386,"date":"2013-07-04T08:25:10","date_gmt":"2013-07-04T06:25:10","guid":{"rendered":"https:\/\/paul-anton.vanhandel.at\/?p=386"},"modified":"2026-07-30T17:42:15","modified_gmt":"2026-07-30T15:42:15","slug":"centos-6-4-postgresql-9-2-statt-mysql-von-lamp-zu-lapp","status":"publish","type":"post","link":"https:\/\/paul-anton.vanhandel.at\/?p=386","title":{"rendered":"CentOS 6.4 &#8211; PostgreSQL 9.2 statt MySQL &#8211; von LAMP zu LAPP"},"content":{"rendered":"<p>In meiner <a title=\"ein einfaches CentOS 6.4 LAMP-System\" href=\"https:\/\/paul-anton.vanhandel.at\/2013\/07\/02\/ein-einfaches-centos-6-4-lamp-system\/\">LAMP Notiz<\/a> habe ich beschrieben, wie MySQL als Teil des Web Stacks installiert wird.<br \/>\nDa ich viele Jahre mit MySQL gearbeitet habe, verwende ich es immer noch gerne f\u00fcr unkritische Applikationen, allerdings ist es ratsam &#8211; man google sich durch &#8211; f\u00fcr kritischere Systeme sein geneigtes Auge auf PostgreSQL zu werfen.<\/p>\n<p>Ich hatte nie Probleme mit MySQL, auch die Schwarzmalerei in manchen Foren kann ich aus eigener Erfahrung nicht immer nachvollziehen. Dennoch werden immer mehr Open Source Systeme mit PostgreSQL statt MySQL implementiert.<\/p>\n<p>Hier ist als der Weg zum LAPP, wobei ich hier nur den Wechsel von MySQL zu PostgreSQL beschreibe, und das nur auf Installationsebene. Um Migration auf Datenebene geht es hier erstmal nicht; falls jemand darauf gehofft hatte &#8211; sorry, aber wer sich bewu\u00dft f\u00fcr einen Wechsel entscheidet, f\u00fcr den sollte eine Datenmigration keine allzu gro\u00dfe Herausforderung darstellen.<\/p>\n<p>Nun also ans Werk:<\/p>\n<p>Soferne bereits installiert, entfernen wir erst einmal MySQL &#8211; oder schalten es zumindest aus und belassen es auf dem System, da\u00df ist wohl auch besser&#8230;<\/p>\n<pre>chkconfig mysqld off\r\nservice mysqld stop<\/pre>\n<p>Nat\u00fcrlich kann man es auch genauso gut laufen lassen, wenn n\u00f6tig.<\/p>\n<p>Jetzt bedarf es ein wenig Vorarbeit, um PostgreSQL (derzeit als 9.2.x stable) gen\u00fc\u00dflich mittels yum zu installieren. Wir ben\u00f6tigen eine weiteres Repository:<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">wget http:\/\/yum.pgrpms.org\/9.2\/redhat\/rhel-6.3-x86_64\/pgdg-centos92-9.2-6.noarch.rpm\r\nrpm -ivh pgdg-centos92-9.2-6.noarch.rpm<\/pre>\n<p>Es empfiehlt sich, auf <a href=\"http:\/\/yum.pgrpms.org\/9.2\/redhat\/rhel-6.3-x86_64\/\">http:\/\/yum.pgrpms.org\/9.2\/redhat\/rhel-6.3-x86_64\/<\/a> zu pr\u00fcfen, ob mittlerweile nicht vielleicht eine aktuellere Version verf\u00fcgbar ist.<\/p>\n<p>Das Repository CentOS_Base h\u00e4lt eine eigene, allerdings sehr veraltete PostgreSQL Version bereit, daher werden wir diese nun ausschlie\u00dfen. Wir editieren<\/p>\n<pre>\/etc\/yum.repos.d\/CentOS-Base.repo<\/pre>\n<p>und f\u00fcgen in den Sektionen <div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container hundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-overflow:visible;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"width:calc( 100% + 0px ) !important;max-width:calc( 100% + 0px ) !important;margin-left: calc(-0px \/ 2 );margin-right: calc(-0px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column fusion-flex-align-self-flex-start fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:0px;--awb-margin-bottom-large:0px;--awb-spacing-left-large:0px;--awb-width-medium:100%;--awb-spacing-right-medium:0px;--awb-spacing-left-medium:0px;--awb-width-small:100%;--awb-spacing-right-small:0px;--awb-spacing-left-small:0px;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\">[base] und [updates] jeweils ein<\/p>\n<pre>exclude=postgresql*<\/pre>\n<p>ein.<\/p>\n<p>Die Installation f\u00fchren wir nun mittels yum durch:<\/p>\n<pre>yum install postgresql92 postgresql92-devel postgresql92-server postgresql92-libs postgresql92-contrib -y<\/pre>\n<p>PostgreSQL f\u00fcr den automatischen Start beim Booten aktivieren wir mit<\/p>\n<pre>chkconfig postgresql-9.2 on<\/pre>\n<p>und starten den Server mit dem bekannten<\/p>\n<pre>service postgresql-9.2 start<\/pre>\n<p>und hoppla&#8230; ganz so einfach ist es nicht, zuerst m\u00fcssen wir PostgreSQL noch die (einmalige) Initialisierung durchf\u00fchren lassen.<\/p>\n<pre>service postgresql-9.2 initdb<\/pre>\n<p>Dies dauert je nach Hardware ein paar wenige Sekunden und nun k\u00f6nnen wir den Server wirklich starten.<\/p>\n<p>In die Konfiguration der Datenbank werde ich hier nicht mehr einsteigen, die Verwandlung von LAMP zu LAPP auf Installationsebene ist abgeschlossen.<\/p>\n<p>Viel Spa\u00df mit PostgreSQL!<\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In meiner LAMP Notiz habe ich beschrieben, wie MySQL als Teil des Web Stacks installiert wird. Da ich viele Jahre mit MySQL gearbeitet habe, verwende ich es immer noch gerne f\u00fcr unkritische Applikationen, allerdings ist es ratsam &#8211; man google sich durch &#8211; f\u00fcr kritischere Systeme sein geneigtes Auge auf PostgreSQL zu werfen. Ich hatte <a href=\"https:\/\/paul-anton.vanhandel.at\/?p=386\"> [&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,1,15,48],"tags":[58,67,74,75,70,68],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-40","category-allgemein","category-lamp","category-linux","tag-centos-6-4","tag-lamp","tag-lapp","tag-postgresql","tag-repository","tag-yum"],"_links":{"self":[{"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=386"}],"version-history":[{"count":1,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":882,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=\/wp\/v2\/posts\/386\/revisions\/882"}],"wp:attachment":[{"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paul-anton.vanhandel.at\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}