├── .github └── workflows │ ├── Dockerfile │ ├── build.yml │ ├── release.yml │ └── test.yml ├── .gitignore ├── COPYRIGHT ├── Makefile ├── README.md ├── SPECS ├── pg_bulkload-pg13.spec ├── pg_bulkload-pg14.spec ├── pg_bulkload-pg15.spec ├── pg_bulkload-pg16.spec └── pg_bulkload-pg17.spec ├── bin ├── Makefile ├── data │ ├── adjust.awk │ ├── bin1.ctl │ ├── bin2.ctl │ ├── bin3.ctl │ ├── bin4.ctl │ ├── bin5.ctl │ ├── bin6.ctl │ ├── binout1.csv │ ├── binout1.ctl │ ├── binout2.csv │ ├── binout2.ctl │ ├── binout3.ctl │ ├── csv1.ctl │ ├── csv10.ctl │ ├── csv2.ctl │ ├── csv3.ctl │ ├── csv4.ctl │ ├── csv5.ctl │ ├── csv6.ctl │ ├── csv7.ctl │ ├── csv8.ctl │ ├── csv9.ctl │ ├── data1.bin │ ├── data1.csv │ ├── data10.csv │ ├── data11.csv │ ├── data2.bin │ ├── data2.csv │ ├── data3.bin │ ├── data3.csv │ ├── data4.bin │ ├── data4.csv │ ├── data5.csv │ ├── data6.csv │ ├── data7.csv │ ├── data8.csv │ ├── data9.csv │ ├── emp.bin │ ├── function1.ctl │ └── gettime.awk ├── expected │ ├── init.out │ ├── init_1.out │ ├── init_2.out │ ├── init_3.out │ ├── load_bin.out │ ├── load_bin_1.out │ ├── load_check.out │ ├── load_check_1.out │ ├── load_csv.out │ ├── load_csv_1.out │ ├── load_csv_2.out │ ├── load_encoding.out │ ├── load_filter.out │ ├── load_filter_1.out │ ├── load_function.out │ ├── load_function_1.out │ ├── load_parallel.out │ ├── load_parallel_1.out │ ├── load_remote.out │ ├── load_remote_1.out │ ├── write_bin.out │ ├── write_bin_1.out │ └── write_bin_2.out ├── pg_bulkload.c ├── pg_bulkload_win32.c ├── pgut │ ├── pgut-fe.c │ ├── pgut-fe.h │ ├── pgut-list.c │ ├── pgut-list.h │ ├── pgut.c │ └── pgut.h ├── postgresql ├── recovery.c └── sql │ ├── init-extension-v2.sql │ ├── init-extension-v3.sql │ ├── init-extension.sql │ ├── load_bin-v1.sql │ ├── load_bin-v2.sql │ ├── load_check.sql │ ├── load_csv-v1.sql │ ├── load_csv-v2.sql │ ├── load_csv-v3.sql │ ├── load_encoding.sql │ ├── load_filter-v2.sql │ ├── load_filter-v3.sql │ ├── load_function-v1.sql │ ├── load_function-v2.sql │ ├── load_function-v3.sql │ ├── load_parallel.sql │ ├── load_remote.sql │ ├── write_bin-v1.sql │ └── write_bin-v2.sql ├── docs ├── img │ ├── appended_load_93.png │ ├── filter.png │ ├── initial_load_93.png │ └── internal.png ├── index.html ├── index_ja.html ├── pg_bulkload-ja.html ├── pg_bulkload.html ├── pg_timestamp-ja.html ├── pg_timestamp.html ├── sample_bin.ctl ├── sample_csv.ctl └── style.css ├── include ├── binary.h ├── common.h ├── logger.h ├── pg_btree.h ├── pg_bulkload.h ├── pg_loadstatus.h ├── pg_profile.h ├── pg_strutil.h ├── reader.h └── writer.h ├── lib ├── Makefile ├── binary.c ├── exports.txt ├── logger.c ├── nbtree │ ├── COPYRIGHT.nbtsort │ ├── nbtsort-10.c │ ├── nbtsort-11.c │ ├── nbtsort-12.c │ ├── nbtsort-13.c │ ├── nbtsort-14.c │ ├── nbtsort-15.c │ ├── nbtsort-16.c │ ├── nbtsort-17.c │ ├── nbtsort-8.3.c │ ├── nbtsort-8.4.c │ ├── nbtsort-9.0.c │ ├── nbtsort-9.1.c │ ├── nbtsort-9.2.c │ ├── nbtsort-9.3.c │ ├── nbtsort-9.4.c │ ├── nbtsort-9.5.c │ ├── nbtsort-9.6.c │ └── nbtsort-common.c ├── parser_binary.c ├── parser_csv.c ├── parser_function.c ├── parser_tuple.c ├── pg_btree.c ├── pg_bulkload.c ├── pg_bulkload.control.in ├── pg_bulkload.sql.in ├── pg_strutil.c ├── pgut │ ├── pgut-be.c │ ├── pgut-be.h │ ├── pgut-ipc.c │ ├── pgut-ipc.h │ ├── pgut-pthread.c │ └── pgut-pthread.h ├── reader.c ├── source.c ├── writer.c ├── writer_binary.c ├── writer_buffered.c ├── writer_direct.c └── writer_parallel.c ├── msvc ├── bin.2010.vcxproj ├── bin.2010.vcxproj.filters ├── bin.vcproj ├── lib.2010.vcxproj ├── lib.2010.vcxproj.filters ├── lib.vcproj ├── pg_bulkload.2010.sln ├── pg_bulkload.sln └── readme.txt └── util ├── Makefile ├── pg_timestamp.c ├── pg_timestamp.sql.in └── uninstall_pg_timestamp.sql /.github/workflows/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG RHEL_VERSION 2 | FROM rockylinux:${RHEL_VERSION} 3 | 4 | ARG RHEL_VERSION 5 | ARG PG_VERSION 6 | ARG PG_BULKLOAD_VERSION 7 | 8 | ENV PATH /usr/pgsql-${PG_VERSION}/bin:$PATH 9 | ENV PGDATA /var/lib/pgsql/${PG_VERSION}/data 10 | 11 | 12 | ################################################################################ 13 | # 14 | # Prerequisite 15 | # 16 | ################################################################################ 17 | 18 | # Install packages for build 19 | RUN dnf update -y 20 | RUN dnf install -y \ 21 | clang gcc git krb5-devel libselinux-devel libzstd-devel lz4-devel make \ 22 | openssl-devel pam-devel readline-devel rpmdevtools zlib-devel 23 | 24 | # Install PostgreSQL 25 | RUN if [ "${RHEL_VERSION}" = "8" ]; then \ 26 | dnf install -y --enablerepo=powertools perl-IPC-Run; \ 27 | else \ 28 | dnf install -y --enablerepo=crb perl-IPC-Run; \ 29 | fi 30 | RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm 31 | RUN dnf -qy module disable postgresql 32 | RUN dnf install -y \ 33 | postgresql${PG_VERSION}-server \ 34 | postgresql${PG_VERSION}-devel \ 35 | postgresql${PG_VERSION}-llvmjit 36 | 37 | 38 | ################################################################################ 39 | # 40 | # Build RPMs 41 | # 42 | ################################################################################ 43 | 44 | # Build by postgres user 45 | USER postgres 46 | WORKDIR /var/lib/pgsql/ 47 | 48 | # Deploy the files required for the build 49 | RUN rpmdev-setuptree 50 | RUN git clone https://github.com/ossc-db/pg_bulkload.git 51 | RUN cp -a pg_bulkload/SPECS/pg_bulkload-pg${PG_VERSION}.spec rpmbuild/SPECS 52 | RUN cd pg_bulkload && \ 53 | git archive VERSION${PG_BULKLOAD_VERSION//./_} \ 54 | --format=tar.gz \ 55 | --prefix=pg_bulkload-${PG_BULKLOAD_VERSION}/ \ 56 | --output=../rpmbuild/SOURCES/pg_bulkload-${PG_BULKLOAD_VERSION}.tar.gz 57 | 58 | # Build RPMs 59 | RUN rpmbuild rpmbuild/SPECS/pg_bulkload-pg${PG_VERSION}.spec \ 60 | -bb --define="dist .pg${PG_VERSION}.rhel${RHEL_VERSION}" 61 | 62 | 63 | ################################################################################ 64 | # 65 | # Run regression tests 66 | # 67 | ################################################################################ 68 | 69 | USER root 70 | RUN rpm -ivh /var/lib/pgsql/rpmbuild/RPMS/x86_64/* 71 | 72 | USER postgres 73 | RUN initdb --no-locale -E UTF8 && \ 74 | pg_ctl -w start && \ 75 | make -C pg_bulkload installcheck 76 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build_with_ubuntu_packages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | timeout-minutes: 20 15 | strategy: 16 | matrix: 17 | PGVERSION: # TODO: build with master branch 18 | - "17" 19 | - "16" 20 | - "15" 21 | - "14" 22 | - "13" 23 | 24 | env: 25 | CACHE_VERSION: 20221222 # to identify cache version 26 | 27 | steps: 28 | - name: cat version 29 | shell: bash -xe {0} 30 | run: | 31 | cat /etc/os-release 32 | uname -a 33 | 34 | - name: get current branch name 35 | shell: bash -xe {0} 36 | run: | 37 | if [ ${{ github.event_name }} = "pull_request" ]; then 38 | echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV 39 | else # push 40 | echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV 41 | fi 42 | 43 | - name: set build postgresql version 44 | shell: bash -xe {0} 45 | run: | 46 | echo "PGVERSION=${{ matrix.PGVERSION }}" >> $GITHUB_ENV 47 | 48 | - name: remove pre-installed postgresql packages 49 | shell: bash -xe {0} 50 | run: sudo apt-get remove postgresql* 51 | 52 | - name: download packages for building 53 | shell: bash -xe {0} 54 | run: | 55 | # https://www.postgresql.org/download/linux/ubuntu/ 56 | sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 57 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 58 | sudo apt-get update 59 | sudo apt-get -y install \ 60 | build-essential \ 61 | libpam-dev \ 62 | libkrb5-dev \ 63 | libssl-dev \ 64 | libreadline-dev \ 65 | libselinux-dev \ 66 | libedit-dev \ 67 | liblz4-dev \ 68 | zlib1g-dev \ 69 | postgresql-${{ env.PGVERSION }} \ 70 | postgresql-server-dev-${{ env.PGVERSION }} 71 | 72 | - uses: actions/checkout@v2 73 | 74 | - name: make # only check if build is success. The tests are skipped because another workflow does so. 75 | shell: bash -xe {0} 76 | run: | 77 | LOGFILE=~/make.log 78 | make 2>&1 | tee $LOGFILE 79 | 80 | - name: show build warning 81 | shell: bash -xe {0} 82 | run: | 83 | LOGFILE=~/make.log 84 | grep -C 1 warning $LOGFILE || exit 0 # ok if warning doesn't exists (= status code is 1) 85 | 86 | - name: check version 87 | shell: bash -xe {0} 88 | run: bin/pg_bulkload --version 89 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Build RPMs and upload its to release draft 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'VERSION*' 7 | 8 | jobs: 9 | build_rpms: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: write 13 | strategy: 14 | matrix: 15 | RHEL_VERSION: ["8", "9"] 16 | PG_VERSION: ["13", "14", "15", "16", "17"] 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v4 20 | 21 | - name: Build PostgreSQL ${{ matrix.PG_VERSION }} RPMs for RHEL ${{ matrix.RHEL_VERSION }} 22 | run: | 23 | export PG_BULKLOAD_VERSION=$(echo "${GITHUB_REF_NAME#VERSION}" | sed 's/_/./g') 24 | docker build .github/workflows/ -t pg_bulkload \ 25 | --build-arg RHEL_VERSION=${{ matrix.RHEL_VERSION }} \ 26 | --build-arg PG_VERSION=${{ matrix.PG_VERSION }} \ 27 | --build-arg PG_BULKLOAD_VERSION=${PG_BULKLOAD_VERSION} 28 | container_id=$(docker create pg_bulkload) 29 | docker cp $container_id:/var/lib/pgsql/rpmbuild/RPMS/x86_64 ./RPMS 30 | 31 | - name: Create release draft and upload the RPMs 32 | uses: softprops/action-gh-release@v2 33 | with: 34 | name: Release draft 35 | draft: true 36 | files: ./RPMS/*.rpm 37 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | timeout-minutes: 20 15 | strategy: 16 | matrix: 17 | PGVERSION: # TODO: build with master branch 18 | - "17.2" 19 | - "16.6" 20 | - "15.10" 21 | - "14.15" 22 | - "13.18" 23 | 24 | env: 25 | CACHE_VERSION: 20221222 # to identify cache version 26 | 27 | steps: 28 | - name: cat version 29 | shell: bash -xe {0} 30 | run: | 31 | cat /etc/os-release 32 | uname -a 33 | 34 | - name: get current branch name 35 | shell: bash -xe {0} 36 | run: | 37 | if [ ${{ github.event_name }} = "pull_request" ]; then 38 | echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV 39 | else # push 40 | echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV 41 | fi 42 | 43 | - name: set build postgresql version 44 | shell: bash -xe {0} 45 | run: | 46 | echo "PGVERSION=${{ matrix.PGVERSION }}" >> $GITHUB_ENV 47 | 48 | - name: cache builded resources 49 | id: cache-postgresql-core 50 | uses: actions/cache@v2 51 | with: 52 | path: "~/pgsql/${{ env.PGVERSION }}" 53 | key: ${{ env.PGVERSION }}-${{ env.CACHE_VERSION }} 54 | 55 | - name: build postgresql 56 | if: steps.cache-postgresql-core.outputs.cache-hit != 'true' 57 | shell: bash -xe {0} 58 | run: | 59 | # set environment variables 60 | export PGHOME=~/pgsql/${{ env.PGVERSION }} 61 | 62 | # install 63 | sudo apt-get update -qq 64 | sudo apt-get -y install bc libpam-dev libedit-dev 65 | wget -q https://ftp.postgresql.org/pub/source/v${{ env.PGVERSION }}/postgresql-${{ env.PGVERSION }}.tar.gz 66 | tar xzf postgresql-${{ env.PGVERSION }}.tar.gz 67 | 68 | # TODO: if test with master branch 69 | # git clone --single-branch --branch ${{ env.PGVERSION }} \ 70 | # https://github.com/postgres/postgres.git ${{ env.PGVERSION }} 71 | 72 | cd postgresql-${{ env.PGVERSION }} 73 | ./configure --prefix=$PGHOME --enable-cassert 74 | 75 | gcc -v 76 | LOGFILE=~/make.log 77 | make -j 4 2>&1 | tee $LOGFILE 78 | make install 2>&1 | tee -a $LOGFILE 79 | 80 | - name: show build warning 81 | if: steps.cache-postgresql-core.outputs.cache-hit != 'true' 82 | shell: bash -xe {0} 83 | run: | 84 | LOGFILE=~/make.log # TODO: though I want to remove duplicated vars... 85 | grep -C 1 warning $LOGFILE || exit 0 # ok if warning doesn't exists (= status code is 1) 86 | 87 | - name: create database directory 88 | shell: bash -xe {0} 89 | run: | 90 | export PGHOME=~/pgsql/${{ env.PGVERSION }} 91 | export PGDATA=~/pgdata/${{ env.PGVERSION }} 92 | export ARCHIVEDIR=~/pgdata/arc 93 | export PATH=$PGHOME/bin:$PATH: 94 | 95 | mkdir -p $PGDATA 96 | initdb --no-locale -D $PGDATA 97 | echo "local all postgres trust" > $PGDATA/pg_hba.conf 98 | echo "local all all trust" >> $PGDATA/pg_hba.conf 99 | echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf 100 | echo "host all all ::1/128 trust" >> $PGDATA/pg_hba.conf 101 | echo "wal_level = hot_standby" >> $PGDATA/postgresql.conf # mapped to "replica" from PG9.6 102 | echo "archive_mode = on" >> $PGDATA/postgresql.conf 103 | echo "archive_command = 'cp %p $ARCHIVEDIR/%f'" >> $PGDATA/postgresql.conf 104 | pg_ctl -V 105 | pg_ctl -D $PGDATA start 106 | 107 | - name: show postgresql configuration 108 | shell: bash -xe {0} 109 | run: | 110 | export PGHOME=~/pgsql/${{ env.PGVERSION }} 111 | export PGDATA=~/pgdata/${{ env.PGVERSION }} 112 | export PATH=$PGHOME/bin:$PATH: 113 | pg_config --version 114 | cat $PGDATA/postgresql.conf 115 | 116 | - uses: actions/checkout@v2 117 | 118 | - name: make install 119 | shell: bash -xe {0} 120 | run: | 121 | export PGHOME=~/pgsql/${{ env.PGVERSION }} 122 | export PATH=$PGHOME/bin:$PATH: 123 | LOGFILE=~/make.log 124 | make install 2>&1 | tee $LOGFILE 125 | 126 | - name: show build warning 127 | shell: bash -xe {0} 128 | run: | 129 | LOGFILE=~/make.log 130 | grep -C 1 warning $LOGFILE || exit 0 # ok if warning doesn't exists (= status code is 1) 131 | 132 | - name: make installcheck 133 | shell: bash -xe {0} 134 | run: | 135 | export PGHOME=~/pgsql/${{ env.PGVERSION }} 136 | export PATH=$PGHOME/bin:$PATH: 137 | make installcheck 138 | 139 | - name: show the result if the regression test failed 140 | if: failure() 141 | shell: bash -xe {0} 142 | run: | 143 | cat bin/regression.diffs \ 144 | && exit 1 # notify fail 145 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.app 17 | 18 | # Dependencies 19 | .deps 20 | 21 | # Binaries 22 | bin/pg_bulkload 23 | 24 | # Generated by test suite 25 | bin/sql 26 | bin/regression.diffs 27 | bin/regression.out 28 | bin/results 29 | 30 | 31 | # Some more 32 | lib/exports.list 33 | lib/pg_bulkload--*.sql 34 | lib/pg_bulkload.control 35 | util/pg_timestamp.sql 36 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2025, NIPPON TELEGRAPH AND TELEPHONE CORPORATION 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the NIPPON TELEGRAPH AND TELEPHONE CORPORATION 13 | (NTT) nor the names of its contributors may be used to endorse or 14 | promote products derived from this software without specific prior 15 | written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pg_bulkload: Makefile 3 | # 4 | # Copyright (c) 2007-2025, NIPPON TELEGRAPH AND TELEPHONE CORPORATION 5 | # 6 | ifndef USE_PGXS 7 | top_builddir = ../.. 8 | makefile_global = $(top_builddir)/src/Makefile.global 9 | ifeq "$(wildcard $(makefile_global))" "" 10 | USE_PGXS = 1 # use pgxs if not in contrib directory 11 | endif 12 | endif 13 | 14 | ifdef USE_PGXS 15 | PG_CONFIG = pg_config 16 | PGXS := $(shell $(PG_CONFIG) --pgxs) 17 | include $(PGXS) 18 | else 19 | subdir = pg_bulkload 20 | include $(makefile_global) 21 | include $(top_srcdir)/contrib/contrib-global.mk 22 | endif 23 | 24 | SUBDIRS = bin lib util 25 | 26 | all install installdirs uninstall distprep clean distclean maintainer-clean: 27 | @for dir in $(SUBDIRS); do \ 28 | $(MAKE) -C $$dir $@ || exit; \ 29 | done 30 | 31 | # We'd like check operations to run all the subtests before failing. 32 | check installcheck: 33 | @CHECKERR=0; for dir in $(SUBDIRS); do \ 34 | $(MAKE) -C $$dir $@ || CHECKERR=$$?; \ 35 | done; \ 36 | exit $$CHECKERR 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | pg_bulkload 2 | ======= 3 | pg_bulkload is a high speed data loading tool for PostgreSQL. 4 | 5 | pg_bulkload is designed to load huge amount of data to a database. 6 | You can load data to table bypassing PostgreSQL shared buffers. 7 | 8 | pg_bulkload also has some ETL features; input data validation and data transformation. 9 | 10 | Branches 11 | -------- 12 | 13 | * master: branch for pg_bulkload 3.2 [![Test](https://github.com/ossc-db/pg_bulkload/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/ossc-db/pg_bulkload/actions/workflows/test.yml) 14 | 15 | How to use 16 | ---------- 17 | pg_bulkload works with control file like below, 18 | 19 | ```` 20 | $ pg_bulkload sample_csv.ctl 21 | NOTICE: BULK LOAD START 22 | NOTICE: BULK LOAD END 23 | 0 Rows skipped. 24 | 8 Rows successfully loaded. 25 | 0 Rows not loaded due to parse errors. 26 | 0 Rows not loaded due to duplicate errors. 27 | 0 Rows replaced with new rows. 28 | ```` 29 | 30 | See documentation about detail usage. 31 | 32 | http://ossc-db.github.io/pg_bulkload/index.html 33 | 34 | How to build and install from source code 35 | ----------------------------------------- 36 | Change directory into top directory of pg_bulkload source codes and 37 | run the below commands. 38 | 39 | ```` 40 | $ make 41 | # make install 42 | ```` 43 | 44 | How to run regression tests 45 | --------------------------- 46 | Start PostgreSQL server and run the below command. 47 | 48 | ```` 49 | $ make installcheck 50 | ```` 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /SPECS/pg_bulkload-pg13.spec: -------------------------------------------------------------------------------- 1 | # SPEC file for pg_bulkload on PostgreSQL 13 2 | # Copyright (C) 2009-2025 NIPPON TELEGRAPH AND TELEPHONE CORPORATION 3 | 4 | %define sname pg_bulkload 5 | %define pgmajorversion 13 6 | 7 | %define _prefix /usr/pgsql-%{pgmajorversion} 8 | %define _libdir %{_prefix}/lib 9 | %define _bcdir %{_libdir}/bitcode/pg_bulkload 10 | 11 | Summary: High speed data load utility for PostgreSQL 12 | Name: %{sname} 13 | Version: 3.1.22 14 | Release: 1%{?dist} 15 | License: BSD 16 | Group: Applications/Databases 17 | # You can get the tarball by following: https://github.com/ossc-db/pg_bulkload/archive/%{version}.tar.gz 18 | Source0: %{sname}-%{version}.tar.gz 19 | URL: http://ossc-db.github.io/pg_bulkload/index.html 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) 21 | 22 | BuildRequires: postgresql13-devel, postgresql13 23 | Requires: postgresql13 24 | 25 | 26 | %description 27 | pg_bulkload provides high-speed data loading capability to PostgreSQL users. 28 | 29 | When we load huge amount of data to a database, it is common situation that data set to be loaded is valid and consistent. For example, dedicated tools are used to prepare such data, providing data validation in advance. In such cases, we'd like to bypass any overheads within database system to load data as quickly as possible. pg_bulkload is developed to help such situations. Therefore, it is not pg_bulkload's goal to provide detailed data validation. Rather, pg_bulkload asumes that loaded data set is validated by separate means. If you're not in such situation, you should use COPY command in PostgreSQL. 30 | 31 | 32 | %package llvmjit 33 | Requires: postgresql13-server, postgresql13-llvmjit 34 | Requires: pg_bulkload = %{version} 35 | Summary: Just-in-time compilation support for pg_bulkload 36 | 37 | %description llvmjit 38 | Just-in-time compilation support for pg_bulkdload 39 | 40 | %prep 41 | rm -rf %{_libdir}/pgxs/src/backend/ 42 | 43 | %setup -n %{sname}-%{version} 44 | 45 | %build 46 | USE_PGXS=1 make %{?_smp_mflags} MAJORVERSION=%{pgmajorversion} 47 | 48 | %install 49 | %define pg_contribdir %{_datadir}/contrib 50 | %define pg_extensiondir %{_datadir}/extension 51 | 52 | rm -rf %{buildroot} 53 | 54 | install -d %{buildroot}%{_bindir} 55 | install -d %{buildroot}%{_libdir} 56 | install -d %{buildroot}%{pg_contribdir} 57 | install -d %{buildroot}%{pg_extensiondir} 58 | install -d %{buildroot}%{_bcdir} 59 | 60 | install -m 755 bin/pg_bulkload %{buildroot}%{_bindir}/pg_bulkload 61 | install -m 755 bin/postgresql %{buildroot}%{_bindir}/postgresql 62 | install -m 755 lib/pg_bulkload.so %{buildroot}%{_libdir}/pg_bulkload.so 63 | install -m 644 lib/pg_bulkload.bc %{buildroot}%{_bcdir}/pg_bulkload.bc 64 | 65 | install -m 644 lib/pg_bulkload.control %{buildroot}%{pg_extensiondir}/pg_bulkload.control 66 | install -m 644 lib/pg_bulkload--%{version}.sql %{buildroot}%{pg_extensiondir}/pg_bulkload--%{version}.sql 67 | 68 | # sample_*.ctl files are needed for rpm users. 69 | # %{sname}-%{version} is the same path with "%setup -n"'s argument. 70 | install -m 644 docs/sample_bin.ctl %{buildroot}%{pg_contribdir}/sample_bin.ctl 71 | install -m 644 docs/sample_csv.ctl %{buildroot}%{pg_contribdir}/sample_csv.ctl 72 | 73 | %files 74 | %defattr(755,root,root,755) 75 | %{_bindir}/pg_bulkload 76 | %{_bindir}/postgresql 77 | %{_libdir}/pg_bulkload.so 78 | %defattr(644,root,root,755) 79 | #%doc README.pg_bulkload 80 | %{pg_contribdir}/sample_bin.ctl 81 | %{pg_contribdir}/sample_csv.ctl 82 | %{pg_extensiondir}/pg_bulkload.control 83 | %{pg_extensiondir}/pg_bulkload--%{version}.sql 84 | 85 | %files llvmjit 86 | %defattr(0755,root,root) 87 | %{_bcdir} 88 | %defattr(0644,root,root) 89 | %{_bcdir}/pg_bulkload.bc 90 | 91 | %clean 92 | rm -rf %{buildroot} 93 | rm -rf %{_libdir}/pgxs/src/backend/ 94 | 95 | %changelog 96 | * Thu Jan 23 2025 - NTT OSS Center 3.1.22-1 97 | - Support PostgreSQL 17 98 | - Update to pg_bulkload 3.1.22 99 | * Thu Jan 16 2024 - NTT OSS Center 3.1.21-1 100 | - Update to pg_bulkload 3.1.21 101 | * Thu Jan 13 2023 - NTT OSS Center 3.1.20-1 102 | - Update to pg_bulkload 3.1.20 103 | * Mon Oct 11 2021 - Masahiro ikeda 3.1.19-1 104 | - Update to pg_bulkload 3.1.19 105 | * Tue Jun 01 2021 - Yanmei Sun 3.1.18-1 106 | - Update to pg_bulkload 3.1.18 107 | * Fri Feb 05 2021 - Moon Insung 3.1.17-1 108 | - Update to pg_bulkload 3.1.17 109 | -------------------------------------------------------------------------------- /SPECS/pg_bulkload-pg14.spec: -------------------------------------------------------------------------------- 1 | # SPEC file for pg_bulkload on PostgreSQL 14 2 | # Copyright (C) 2009-2025 NIPPON TELEGRAPH AND TELEPHONE CORPORATION 3 | 4 | %define sname pg_bulkload 5 | %define pgmajorversion 14 6 | 7 | %define _prefix /usr/pgsql-%{pgmajorversion} 8 | %define _libdir %{_prefix}/lib 9 | %define _bcdir %{_libdir}/bitcode/pg_bulkload 10 | 11 | Summary: High speed data load utility for PostgreSQL 12 | Name: %{sname} 13 | Version: 3.1.22 14 | Release: 1%{?dist} 15 | License: BSD 16 | Group: Applications/Databases 17 | # You can get the tarball by following: https://github.com/ossc-db/pg_bulkload/archive/%{version}.tar.gz 18 | Source0: %{sname}-%{version}.tar.gz 19 | URL: http://ossc-db.github.io/pg_bulkload/index.html 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) 21 | 22 | BuildRequires: postgresql14-devel, postgresql14 23 | Requires: postgresql14 24 | 25 | 26 | %description 27 | pg_bulkload provides high-speed data loading capability to PostgreSQL users. 28 | 29 | When we load huge amount of data to a database, it is common situation that data set to be loaded is valid and consistent. For example, dedicated tools are used to prepare such data, providing data validation in advance. In such cases, we'd like to bypass any overheads within database system to load data as quickly as possible. pg_bulkload is developed to help such situations. Therefore, it is not pg_bulkload's goal to provide detailed data validation. Rather, pg_bulkload asumes that loaded data set is validated by separate means. If you're not in such situation, you should use COPY command in PostgreSQL. 30 | 31 | 32 | %package llvmjit 33 | Requires: postgresql14-server, postgresql14-llvmjit 34 | Requires: pg_bulkload = %{version} 35 | Summary: Just-in-time compilation support for pg_bulkload 36 | 37 | %description llvmjit 38 | Just-in-time compilation support for pg_bulkdload 39 | 40 | %prep 41 | rm -rf %{_libdir}/pgxs/src/backend/ 42 | 43 | %setup -n %{sname}-%{version} 44 | 45 | %build 46 | USE_PGXS=1 make %{?_smp_mflags} MAJORVERSION=%{pgmajorversion} 47 | 48 | %install 49 | %define pg_contribdir %{_datadir}/contrib 50 | %define pg_extensiondir %{_datadir}/extension 51 | 52 | rm -rf %{buildroot} 53 | 54 | install -d %{buildroot}%{_bindir} 55 | install -d %{buildroot}%{_libdir} 56 | install -d %{buildroot}%{pg_contribdir} 57 | install -d %{buildroot}%{pg_extensiondir} 58 | install -d %{buildroot}%{_bcdir} 59 | 60 | install -m 755 bin/pg_bulkload %{buildroot}%{_bindir}/pg_bulkload 61 | install -m 755 bin/postgresql %{buildroot}%{_bindir}/postgresql 62 | install -m 755 lib/pg_bulkload.so %{buildroot}%{_libdir}/pg_bulkload.so 63 | install -m 644 lib/pg_bulkload.bc %{buildroot}%{_bcdir}/pg_bulkload.bc 64 | 65 | install -m 644 lib/pg_bulkload.control %{buildroot}%{pg_extensiondir}/pg_bulkload.control 66 | install -m 644 lib/pg_bulkload--%{version}.sql %{buildroot}%{pg_extensiondir}/pg_bulkload--%{version}.sql 67 | 68 | # sample_*.ctl files are needed for rpm users. 69 | # %{sname}-%{version} is the same path with "%setup -n"'s argument. 70 | install -m 644 docs/sample_bin.ctl %{buildroot}%{pg_contribdir}/sample_bin.ctl 71 | install -m 644 docs/sample_csv.ctl %{buildroot}%{pg_contribdir}/sample_csv.ctl 72 | 73 | %files 74 | %defattr(755,root,root,755) 75 | %{_bindir}/pg_bulkload 76 | %{_bindir}/postgresql 77 | %{_libdir}/pg_bulkload.so 78 | %defattr(644,root,root,755) 79 | #%doc README.pg_bulkload 80 | %{pg_contribdir}/sample_bin.ctl 81 | %{pg_contribdir}/sample_csv.ctl 82 | %{pg_extensiondir}/pg_bulkload.control 83 | %{pg_extensiondir}/pg_bulkload--%{version}.sql 84 | 85 | %files llvmjit 86 | %defattr(0755,root,root) 87 | %{_bcdir} 88 | %defattr(0644,root,root) 89 | %{_bcdir}/pg_bulkload.bc 90 | 91 | %clean 92 | rm -rf %{buildroot} 93 | rm -rf %{_libdir}/pgxs/src/backend/ 94 | 95 | %changelog 96 | * Thu Jan 23 2025 - NTT OSS Center 3.1.22-1 97 | - Support PostgreSQL 17 98 | - Update to pg_bulkload 3.1.22 99 | * Thu Jan 16 2024 - NTT OSS Center 3.1.21-1 100 | - Update to pg_bulkload 3.1.21 101 | * Thu Jan 13 2023 - NTT OSS Center 3.1.20-1 102 | - Update to pg_bulkload 3.1.20 103 | * Mon Oct 11 2021 - Masahiro ikeda 3.1.19-1 104 | - Support PostgreSQL 14 105 | - Update to pg_bulkload 3.1.19 106 | -------------------------------------------------------------------------------- /SPECS/pg_bulkload-pg15.spec: -------------------------------------------------------------------------------- 1 | # SPEC file for pg_bulkload on PostgreSQL 15 2 | # Copyright (C) 2022-2025 NIPPON TELEGRAPH AND TELEPHONE CORPORATION 3 | 4 | %define sname pg_bulkload 5 | %define pgmajorversion 15 6 | 7 | %define _prefix /usr/pgsql-%{pgmajorversion} 8 | %define _libdir %{_prefix}/lib 9 | %define _bcdir %{_libdir}/bitcode/pg_bulkload 10 | 11 | Summary: High speed data load utility for PostgreSQL 12 | Name: %{sname} 13 | Version: 3.1.22 14 | Release: 1%{?dist} 15 | License: BSD 16 | Group: Applications/Databases 17 | # You can get the tarball by following: https://github.com/ossc-db/pg_bulkload/archive/%{version}.tar.gz 18 | Source0: %{sname}-%{version}.tar.gz 19 | URL: http://ossc-db.github.io/pg_bulkload/index.html 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) 21 | 22 | BuildRequires: postgresql15-devel, postgresql15 23 | Requires: postgresql15 24 | 25 | 26 | %description 27 | pg_bulkload provides high-speed data loading capability to PostgreSQL users. 28 | 29 | When we load huge amount of data to a database, it is common situation that data set to be loaded is valid and consistent. For example, dedicated tools are used to prepare such data, providing data validation in advance. In such cases, we'd like to bypass any overheads within database system to load data as quickly as possible. pg_bulkload is developed to help such situations. Therefore, it is not pg_bulkload's goal to provide detailed data validation. Rather, pg_bulkload asumes that loaded data set is validated by separate means. If you're not in such situation, you should use COPY command in PostgreSQL. 30 | 31 | 32 | %package llvmjit 33 | Requires: postgresql15-server, postgresql15-llvmjit 34 | Requires: pg_bulkload = %{version} 35 | Summary: Just-in-time compilation support for pg_bulkload 36 | 37 | %description llvmjit 38 | Just-in-time compilation support for pg_bulkdload 39 | 40 | %prep 41 | rm -rf %{_libdir}/pgxs/src/backend/ 42 | 43 | %setup -n %{sname}-%{version} 44 | 45 | %build 46 | USE_PGXS=1 make %{?_smp_mflags} MAJORVERSION=%{pgmajorversion} 47 | 48 | %install 49 | %define pg_contribdir %{_datadir}/contrib 50 | %define pg_extensiondir %{_datadir}/extension 51 | 52 | rm -rf %{buildroot} 53 | 54 | install -d %{buildroot}%{_bindir} 55 | install -d %{buildroot}%{_libdir} 56 | install -d %{buildroot}%{pg_contribdir} 57 | install -d %{buildroot}%{pg_extensiondir} 58 | install -d %{buildroot}%{_bcdir} 59 | 60 | install -m 755 bin/pg_bulkload %{buildroot}%{_bindir}/pg_bulkload 61 | install -m 755 bin/postgresql %{buildroot}%{_bindir}/postgresql 62 | install -m 755 lib/pg_bulkload.so %{buildroot}%{_libdir}/pg_bulkload.so 63 | install -m 644 lib/pg_bulkload.bc %{buildroot}%{_bcdir}/pg_bulkload.bc 64 | 65 | install -m 644 lib/pg_bulkload.control %{buildroot}%{pg_extensiondir}/pg_bulkload.control 66 | install -m 644 lib/pg_bulkload--%{version}.sql %{buildroot}%{pg_extensiondir}/pg_bulkload--%{version}.sql 67 | 68 | # sample_*.ctl files are needed for rpm users. 69 | # %{sname}-%{version} is the same path with "%setup -n"'s argument. 70 | install -m 644 docs/sample_bin.ctl %{buildroot}%{pg_contribdir}/sample_bin.ctl 71 | install -m 644 docs/sample_csv.ctl %{buildroot}%{pg_contribdir}/sample_csv.ctl 72 | 73 | %files 74 | %defattr(755,root,root,755) 75 | %{_bindir}/pg_bulkload 76 | %{_bindir}/postgresql 77 | %{_libdir}/pg_bulkload.so 78 | %defattr(644,root,root,755) 79 | #%doc README.pg_bulkload 80 | %{pg_contribdir}/sample_bin.ctl 81 | %{pg_contribdir}/sample_csv.ctl 82 | %{pg_extensiondir}/pg_bulkload.control 83 | %{pg_extensiondir}/pg_bulkload--%{version}.sql 84 | 85 | %files llvmjit 86 | %defattr(0755,root,root) 87 | %{_bcdir} 88 | %defattr(0644,root,root) 89 | %{_bcdir}/pg_bulkload.bc 90 | 91 | %clean 92 | rm -rf %{buildroot} 93 | rm -rf %{_libdir}/pgxs/src/backend/ 94 | 95 | %changelog 96 | * Thu Jan 23 2025 - NTT OSS Center 3.1.22-1 97 | - Support PostgreSQL 17 98 | - Update to pg_bulkload 3.1.22 99 | * Thu Jan 16 2024 - NTT OSS Center 3.1.21-1 100 | - Update to pg_bulkload 3.1.21 101 | * Thu Jan 13 2023 - NTT OSS Center 3.1.20-1 102 | - Support PostgreSQL 15 103 | - Update to pg_bulkload 3.1.20 104 | -------------------------------------------------------------------------------- /SPECS/pg_bulkload-pg16.spec: -------------------------------------------------------------------------------- 1 | # SPEC file for pg_bulkload on PostgreSQL 16 2 | # Copyright (C) 2023-2025 NIPPON TELEGRAPH AND TELEPHONE CORPORATION 3 | 4 | %define sname pg_bulkload 5 | %define pgmajorversion 16 6 | 7 | %define _prefix /usr/pgsql-%{pgmajorversion} 8 | %define _libdir %{_prefix}/lib 9 | %define _bcdir %{_libdir}/bitcode/pg_bulkload 10 | 11 | Summary: High speed data load utility for PostgreSQL 12 | Name: %{sname} 13 | Version: 3.1.22 14 | Release: 1%{?dist} 15 | License: BSD 16 | Group: Applications/Databases 17 | # You can get the tarball by following: https://github.com/ossc-db/pg_bulkload/archive/%{version}.tar.gz 18 | Source0: %{sname}-%{version}.tar.gz 19 | URL: http://ossc-db.github.io/pg_bulkload/index.html 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) 21 | 22 | BuildRequires: postgresql16-devel, postgresql16 23 | Requires: postgresql16 24 | 25 | 26 | %description 27 | pg_bulkload provides high-speed data loading capability to PostgreSQL users. 28 | 29 | When we load huge amount of data to a database, it is common situation that data set to be loaded is valid and consistent. For example, dedicated tools are used to prepare such data, providing data validation in advance. In such cases, we'd like to bypass any overheads within database system to load data as quickly as possible. pg_bulkload is developed to help such situations. Therefore, it is not pg_bulkload's goal to provide detailed data validation. Rather, pg_bulkload asumes that loaded data set is validated by separate means. If you're not in such situation, you should use COPY command in PostgreSQL. 30 | 31 | 32 | %package llvmjit 33 | Requires: postgresql16-server, postgresql16-llvmjit 34 | Requires: pg_bulkload = %{version} 35 | Summary: Just-in-time compilation support for pg_bulkload 36 | 37 | %description llvmjit 38 | Just-in-time compilation support for pg_bulkdload 39 | 40 | %prep 41 | rm -rf %{_libdir}/pgxs/src/backend/ 42 | 43 | %setup -n %{sname}-%{version} 44 | 45 | %build 46 | USE_PGXS=1 make %{?_smp_mflags} MAJORVERSION=%{pgmajorversion} 47 | 48 | %install 49 | %define pg_contribdir %{_datadir}/contrib 50 | %define pg_extensiondir %{_datadir}/extension 51 | 52 | rm -rf %{buildroot} 53 | 54 | install -d %{buildroot}%{_bindir} 55 | install -d %{buildroot}%{_libdir} 56 | install -d %{buildroot}%{pg_contribdir} 57 | install -d %{buildroot}%{pg_extensiondir} 58 | install -d %{buildroot}%{_bcdir} 59 | 60 | install -m 755 bin/pg_bulkload %{buildroot}%{_bindir}/pg_bulkload 61 | install -m 755 bin/postgresql %{buildroot}%{_bindir}/postgresql 62 | install -m 755 lib/pg_bulkload.so %{buildroot}%{_libdir}/pg_bulkload.so 63 | install -m 644 lib/pg_bulkload.bc %{buildroot}%{_bcdir}/pg_bulkload.bc 64 | 65 | install -m 644 lib/pg_bulkload.control %{buildroot}%{pg_extensiondir}/pg_bulkload.control 66 | install -m 644 lib/pg_bulkload--%{version}.sql %{buildroot}%{pg_extensiondir}/pg_bulkload--%{version}.sql 67 | 68 | # sample_*.ctl files are needed for rpm users. 69 | # %{sname}-%{version} is the same path with "%setup -n"'s argument. 70 | install -m 644 docs/sample_bin.ctl %{buildroot}%{pg_contribdir}/sample_bin.ctl 71 | install -m 644 docs/sample_csv.ctl %{buildroot}%{pg_contribdir}/sample_csv.ctl 72 | 73 | %files 74 | %defattr(755,root,root,755) 75 | %{_bindir}/pg_bulkload 76 | %{_bindir}/postgresql 77 | %{_libdir}/pg_bulkload.so 78 | %defattr(644,root,root,755) 79 | #%doc README.pg_bulkload 80 | %{pg_contribdir}/sample_bin.ctl 81 | %{pg_contribdir}/sample_csv.ctl 82 | %{pg_extensiondir}/pg_bulkload.control 83 | %{pg_extensiondir}/pg_bulkload--%{version}.sql 84 | 85 | %files llvmjit 86 | %defattr(0755,root,root) 87 | %{_bcdir} 88 | %defattr(0644,root,root) 89 | %{_bcdir}/pg_bulkload.bc 90 | 91 | %clean 92 | rm -rf %{buildroot} 93 | rm -rf %{_libdir}/pgxs/src/backend/ 94 | 95 | %changelog 96 | * Thu Jan 23 2025 - NTT OSS Center 3.1.22-1 97 | - Support PostgreSQL 17 98 | - Update to pg_bulkload 3.1.22 99 | * Thu Jan 16 2024 - NTT OSS Center 3.1.21-1 100 | - Support PostgreSQL 16 101 | - Update to pg_bulkload 3.1.21 102 | -------------------------------------------------------------------------------- /SPECS/pg_bulkload-pg17.spec: -------------------------------------------------------------------------------- 1 | # SPEC file for pg_bulkload on PostgreSQL 17 2 | # Copyright (C) 2024-2025 NIPPON TELEGRAPH AND TELEPHONE CORPORATION 3 | 4 | %define sname pg_bulkload 5 | %define pgmajorversion 17 6 | 7 | %define _prefix /usr/pgsql-%{pgmajorversion} 8 | %define _libdir %{_prefix}/lib 9 | %define _bcdir %{_libdir}/bitcode/pg_bulkload 10 | 11 | Summary: High speed data load utility for PostgreSQL 12 | Name: %{sname} 13 | Version: 3.1.22 14 | Release: 1%{?dist} 15 | License: BSD 16 | Group: Applications/Databases 17 | # You can get the tarball by following: https://github.com/ossc-db/pg_bulkload/archive/%{version}.tar.gz 18 | Source0: %{sname}-%{version}.tar.gz 19 | URL: http://ossc-db.github.io/pg_bulkload/index.html 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) 21 | 22 | BuildRequires: postgresql17-devel, postgresql17 23 | Requires: postgresql17 24 | 25 | 26 | %description 27 | pg_bulkload provides high-speed data loading capability to PostgreSQL users. 28 | 29 | When we load huge amount of data to a database, it is common situation that data set to be loaded is valid and consistent. For example, dedicated tools are used to prepare such data, providing data validation in advance. In such cases, we'd like to bypass any overheads within database system to load data as quickly as possible. pg_bulkload is developed to help such situations. Therefore, it is not pg_bulkload's goal to provide detailed data validation. Rather, pg_bulkload asumes that loaded data set is validated by separate means. If you're not in such situation, you should use COPY command in PostgreSQL. 30 | 31 | 32 | %package llvmjit 33 | Requires: postgresql17-server, postgresql17-llvmjit 34 | Requires: pg_bulkload = %{version} 35 | Summary: Just-in-time compilation support for pg_bulkload 36 | 37 | %description llvmjit 38 | Just-in-time compilation support for pg_bulkdload 39 | 40 | %prep 41 | rm -rf %{_libdir}/pgxs/src/backend/ 42 | 43 | %setup -n %{sname}-%{version} 44 | 45 | %build 46 | USE_PGXS=1 make %{?_smp_mflags} MAJORVERSION=%{pgmajorversion} 47 | 48 | %install 49 | %define pg_contribdir %{_datadir}/contrib 50 | %define pg_extensiondir %{_datadir}/extension 51 | 52 | rm -rf %{buildroot} 53 | 54 | install -d %{buildroot}%{_bindir} 55 | install -d %{buildroot}%{_libdir} 56 | install -d %{buildroot}%{pg_contribdir} 57 | install -d %{buildroot}%{pg_extensiondir} 58 | install -d %{buildroot}%{_bcdir} 59 | 60 | install -m 755 bin/pg_bulkload %{buildroot}%{_bindir}/pg_bulkload 61 | install -m 755 bin/postgresql %{buildroot}%{_bindir}/postgresql 62 | install -m 755 lib/pg_bulkload.so %{buildroot}%{_libdir}/pg_bulkload.so 63 | install -m 644 lib/pg_bulkload.bc %{buildroot}%{_bcdir}/pg_bulkload.bc 64 | 65 | install -m 644 lib/pg_bulkload.control %{buildroot}%{pg_extensiondir}/pg_bulkload.control 66 | install -m 644 lib/pg_bulkload--%{version}.sql %{buildroot}%{pg_extensiondir}/pg_bulkload--%{version}.sql 67 | 68 | # sample_*.ctl files are needed for rpm users. 69 | # %{sname}-%{version} is the same path with "%setup -n"'s argument. 70 | install -m 644 docs/sample_bin.ctl %{buildroot}%{pg_contribdir}/sample_bin.ctl 71 | install -m 644 docs/sample_csv.ctl %{buildroot}%{pg_contribdir}/sample_csv.ctl 72 | 73 | %files 74 | %defattr(755,root,root,755) 75 | %{_bindir}/pg_bulkload 76 | %{_bindir}/postgresql 77 | %{_libdir}/pg_bulkload.so 78 | %defattr(644,root,root,755) 79 | #%doc README.pg_bulkload 80 | %{pg_contribdir}/sample_bin.ctl 81 | %{pg_contribdir}/sample_csv.ctl 82 | %{pg_extensiondir}/pg_bulkload.control 83 | %{pg_extensiondir}/pg_bulkload--%{version}.sql 84 | 85 | %files llvmjit 86 | %defattr(0755,root,root) 87 | %{_bcdir} 88 | %defattr(0644,root,root) 89 | %{_bcdir}/pg_bulkload.bc 90 | 91 | %clean 92 | rm -rf %{buildroot} 93 | rm -rf %{_libdir}/pgxs/src/backend/ 94 | 95 | %changelog 96 | * Thu Jan 23 2025 - NTT OSS Center 3.1.22-1 97 | - Support PostgreSQL 17 98 | - Update to pg_bulkload 3.1.22 99 | -------------------------------------------------------------------------------- /bin/data/adjust.awk: -------------------------------------------------------------------------------- 1 | BEGIN \ 2 | {\ 3 | FS="/" \ 4 | }\ 5 | {\ 6 | if (NF > 2) \ 7 | {\ 8 | gsub(" [a-zA-z]:.*$"," ",$1);\ 9 | print $1 ".../" $NF\ 10 | }\ 11 | else\ 12 | {\ 13 | gsub(" on .*$", " on ");\ 14 | gsub("CPU [0-9]+\\.[0-9][0-9]", "CPU