logo

PostgreSQLのDBのバックアップ・リストア

▶カスタム形式(圧縮) $ pg_dump -Fc データベース名 -f データベース.date +%Y%m%d.sql $ pg_restore -d データベース名 データベース.date +%Y%m%d.sql 全DBのバックアップ [#a584a459]

One minute to read

PostgreSQLのDB操作

Access pribileges の部分が空だとselectすらも出来ない。 アクセス権付与 [#a716e76b]

One minute to read

PostgreSQLのインストール

$su -

yum install readline-devel

su - posgres

$ cd posgres-9.0.4 $ ./configure $ make All of PostgreSQL successfully made. Ready to install. $ su - $ cd /home/postgres/postgres-9.0.4/ $ make install PostgreSQL installation complete. $ vi /home/postgres/.bash_profile export PATH=/usr/local/pgsql/bin:$PATH export LD_LIBRARY_PATH=/usr/local/pgsql/lib:$LD_LIBRARY_PATH $ source .bash_profile $ initdb -D /home/postgres/data –no-locale Success. You can now start the database server using:

※locale、エンコーディングは未指定の場合はOSのものがtemplateに登録される。後から指定可能だが、エンコーディングはlocaleと互換性が無いと問題が発生する可能があるため、localeは–no-localeにしておくことが推奨される。

$ pg_ctl start -D /home/postgres/data/ -w server started $ ps aux | grep postgres postgres 14817 0.6 0.2 53088 4140 pts/0 S 16:03 0:00 /usr/local/pgsql/bin/postgres -D /home/postgres/data postgres 14819 0.0 0.0 53088 1024 ? Ss 16:03 0:00 postgres: writer process postgres 14820 0.0 0.0 53088 928 ? Ss 16:03 0:00 postgres: wal writer process postgres 14821 0.0 0.0 53924 1864 ? Ss 16:03 0:00 postgres: autovacuum launcher process postgres 14822 0.0 0.0 16132 932 ? Ss 16:03 0:00 postgres: stats collector process

アンインストール [#m8cb039e]

2 minutes to read

PostgreSQLの基本操作

PostgreSQL 8.1.23 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) (1 row)

PostgreSQL再起動 [#ke01e354]

3 minutes to read

Pound

One minute to read