Postgresql
普段はMySQLしか使用しないので他のデータベースも扱ってみる
確認
yumで確認
$ sudo yum list | grep postgresql postgresql-libs.x86_64 8.4.20-1.el6_5 @updates asterisk-postgresql.x86_64 1.8.32.1-1.el6 epel bacula-director-postgresql.x86_64 5.0.0-12.el6 base bacula-storage-postgresql.x86_64 5.0.0-12.el6 base collectd-postgresql.x86_64 4.10.9-1.el6 epel freeradius-postgresql.x86_64 2.1.12-6.el6 base lua-sql-postgresql.x86_64 2.1.1-7.el6 epel mono-data-postgresql.x86_64 2.10.8-4.el6 epel opensips-postgresql.x86_64 1.7.2-2.el6 epel owncloud-postgresql.noarch 6.0.6-1.el6 epel pdns-backend-postgresql.x86_64 3.3.1-1.el6 epel postgresql.i686 8.4.20-1.el6_5 base postgresql.x86_64 8.4.20-1.el6_5 base postgresql-contrib.x86_64 8.4.20-1.el6_5 base postgresql-devel.i686 8.4.20-1.el6_5 base postgresql-devel.x86_64 8.4.20-1.el6_5 base postgresql-docs.x86_64 8.4.20-1.el6_5 base postgresql-ip4r.x86_64 1.05-1.el6 epel postgresql-jdbc.noarch 8.4.704-2.el6 base postgresql-libs.i686 8.4.20-1.el6_5 base postgresql-odbc.x86_64 08.04.0200-1.el6 base postgresql-pgpool-II.i686 3.2.0-1.el6 epel postgresql-pgpool-II.x86_64 3.2.0-1.el6 epel postgresql-pgpool-II-devel.i686 3.2.0-1.el6 epel postgresql-pgpool-II-devel.x86_64 3.2.0-1.el6 epel postgresql-pgpool-II-recovery.x86_64 3.2.0-1.el6 epel postgresql-plperl.x86_64 8.4.20-1.el6_5 base postgresql-plpython.x86_64 8.4.20-1.el6_5 base postgresql-plruby.x86_64 0.5.3-4.el6 epel postgresql-plruby-doc.x86_64 0.5.3-4.el6 epel postgresql-pltcl.x86_64 8.4.20-1.el6_5 base postgresql-server.x86_64 8.4.20-1.el6_5 base postgresql-test.x86_64 8.4.20-1.el6_5 base postgresql_autodoc.noarch 1.41-1.el6 epel proftpd-postgresql.x86_64 1.3.3g-4.el6 epel qt-postgresql.i686 1:4.6.2-28.el6_5 base qt-postgresql.x86_64 1:4.6.2-28.el6_5 base qt5-qtbase-postgresql.i686 5.4.0-4.el6 epel qt5-qtbase-postgresql.x86_64 5.4.0-4.el6 epel rekall-postgresql.i686 2.4.6-13.el6 epel rekall-postgresql.x86_64 2.4.6-13.el6 epel soci-postgresql.i686 3.2.2-2.el6 epel soci-postgresql.x86_64 3.2.2-2.el6 epel soci-postgresql-devel.i686 3.2.2-2.el6 epel soci-postgresql-devel.x86_64 3.2.2-2.el6 epel $
公式サイトにあるものを参考にする
実行
リポジトリをインストール
sudo rpm -i http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
検索
$ sudo yum search postgresql93 読み込んだプラグイン:downloadonly, fastestmirror, priorities Loading mirror speeds from cached hostfile * base: mirror.fairway.ne.jp * epel: mirror.premi.st * extras: mirror.fairway.ne.jp * updates: mirror.fairway.ne.jp * webtatic: us-east.repo.webtatic.com ========================================================= N/S Matched: postgresql93 ========================================================= postgresql93-debuginfo.x86_64 : Debug information for package postgresql93 postgresql93-jdbc-debuginfo.x86_64 : Debug information for package postgresql93-jdbc postgresql93-odbc-debuginfo.x86_64 : Debug information for package postgresql93-odbc postgresql93-python-debuginfo.x86_64 : Debug information for package postgresql93-python postgresql93.x86_64 : PostgreSQL client programs and libraries postgresql93-contrib.x86_64 : Contributed source and binaries distributed with PostgreSQL postgresql93-devel.x86_64 : PostgreSQL development header files and libraries postgresql93-docs.x86_64 : Extra documentation for PostgreSQL postgresql93-jdbc.x86_64 : JDBC driver for PostgreSQL postgresql93-libs.x86_64 : The shared libraries required for any PostgreSQL clients postgresql93-odbc.x86_64 : PostgreSQL ODBC driver postgresql93-plperl.x86_64 : The Perl procedural language for PostgreSQL postgresql93-plpython.x86_64 : The Python procedural language for PostgreSQL postgresql93-pltcl.x86_64 : The Tcl procedural language for PostgreSQL postgresql93-python.x86_64 : Development module for Python code to access a PostgreSQL DB postgresql93-server.x86_64 : The programs needed to create and run a PostgreSQL server postgresql93-test.x86_64 : The test suite distributed with PostgreSQL Name and summary matches only, use "search all" for everything. [vagrant@localhost ~]$
インストール
sudo yum install postgresql93 postgresql93-server postgresql93-test postgresql93-contrib postgresql93-devel
初期化
$ sudo service postgresql-9.3 initdb Initializing database: [ OK ] $
自動起動設定
$ sudo chkconfig postgresql-9.3 on
起動
$ sudo service postgresql-9.3 start Starting postgresql-9.3 service: [ OK ] $
とりあえず今回はここまで
データベースの作成とかテーブルの制御とかはそのうちやる