LoginSignup
3
3

More than 5 years have passed since last update.

PostgreSQL 9.4.x に pg_bulkload をインストールする方法

Posted at

PostgreSQLの高速データローダpg_bulkloadのPostgreSQL 9.4.x向けのリリースが出ていたので、インストール方法のメモを残しておく。
公式サイトに載っている説明だと、拡張をインストールするSQLファイルのパスが間違っているっぽい。

ビルド

pg_configコマンドにパスが通っている場合には、下記のコマンドでインストールできる。

make USE_PGXS=1
make USE_PGXS=1 install

pg_configにパスが通っていない場合には、環境変数で明示的に指定する。

make USE_PGXS=1 PG_CONFIG=/path/to/pg_config
make USE_PGXS=1 PG_CONFIG=/path/to/pg_config install

make installはルート権限が必要な場合には適宜 sudo などすること。

拡張関数を登録

この作業は、pg_bulkloadを利用してデータを投入したいPostgreSQLのデータベースごとに実行する必要あり。

psql DATABASE_NAME -f `pg_config --sharedir`/extension/pg_bulkload.sql
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3