reorg / pg_repack

Reorganize tables in PostgreSQL databases with minimal locks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pg_repack v.1.4.7 won't build

scythargon opened this issue · comments

Hello

make
make[1]: Entering directory '/root/pg_repack/bin'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -I/usr/include/postgresql -DREPACK_VERSION=1.4.7 -I. -I./ -I/usr/include/postgresql/16/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o pgut/pgut-fe.o pgut/pgut-fe.c
pgut/pgut-fe.c: In function ‘get_username’:
pgut/pgut-fe.c:652:7: warning: implicit declaration of function ‘getpwuid’; did you mean ‘geteuid’? [-Wimplicit-function-declaration]
  pw = getpwuid(geteuid());
       ^~~~~~~~
       geteuid
pgut/pgut-fe.c:652:5: warning: assignment to ‘struct passwd *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  pw = getpwuid(geteuid());
     ^
pgut/pgut-fe.c:653:16: error: dereferencing pointer to incomplete type ‘struct passwd’
  ret = (pw ? pw->pw_name : NULL);
                ^~
make[1]: *** [<builtin>: pgut/pgut-fe.o] Error 1
make[1]: Leaving directory '/root/pg_repack/bin'
make: *** [Makefile:35: all] Error 2

To use a newer version is not an option for me unfortunately because I can't update the extension version on my remote postgres server.
Thank you.

Nevermind, I managed to build it by reproducing the instructions from travis_setup.sh.

We get same issue while trying to install pg_repack-1.4.7 on Amzon linux and centos.Please share the steps which resolved issue for you.
below are the commands we tried.
sudo yum install gcc postgresql-devel openssl-devel postgresql-static.x86_64 readline-devel lz4-devel -y
sudo wget https://api.pgxn.org/dist/pg_repack/1.4.7/pg_repack-1.4.7.zip
sudo unzip pg_repack-1.4.7.zip
cd pg_repack-1.4.7
sudo make install
cd bin
./pg_repack —version
which pg_repack