0

I want to perform pg_repack in remote postgres server. pg_repack is used to remove bloat from PostgreSQL.

I am following this for reference: https://reorg.github.io/pg_repack/#installation

After installing pgxn, we need to install pg_repack. It's done by

sudo pgxn install pg_repack

And it's resulting in this

INFO: best version: pg_repack 1.4.8
INFO: saving /tmp/tmp3dyb4e3e/pg_repack-1.4.8.zip
INFO: unpacking: /tmp/tmp3dyb4e3e/pg_repack-1.4.8.zip
INFO: building extension
gmake[1]: Entering directory '/tmp/tmp3dyb4e3e/pg_repack-1.4.8/bin'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -I/usr/include/postgresql -DREPACK_VERSION=1.4.8 -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o pg_repack.o pg_repack.c
gmake[1]: gcc: No such file or directory
gmake[1]: *** [<builtin>: pg_repack.o] Error 127
gmake[1]: Leaving directory '/tmp/tmp3dyb4e3e/pg_repack-1.4.8/bin'
gmake: *** [Makefile:35: all] Error 2
ERROR: command returned 2: gmake PG_CONFIG=/usr/bin/pg_config all`

I tried to clone this repo and perform gmake on it directly

gmake PG_CONFIG=/pg_config all

but still I'm getting

gmake: *** No rule to make target 'all'.  Stop.
  • where is your pg_config binary (full path name)? – jian Feb 01 '23 at 10:40
  • @jian on running which pg_config i got /usr/bin/pg_config. – Prince Kushwaha Feb 01 '23 at 10:47
  • @jian Also, the repo i meantioned in question on which i tried gmake is this : [link](https://github.com/reorg/pg_repack) here – Prince Kushwaha Feb 01 '23 at 10:48
  • If you have multi version of postgres, then you need the absolute full path. in my case I do something like: `make PG_CONFIG=/usr/local/pgsql15/bin/pg_config` and you don't need "all" – jian Feb 01 '23 at 11:02
  • I want to connect to postgres hosted on another server. Objective is to use pg_repack from my system on postgres hosted elsewhere, In your case postgres is in same machine where you're trying pg_repack. any idea how to accomplish that, Thanks in advance. – Prince Kushwaha Feb 01 '23 at 11:09

0 Answers0