Skip to content
Advertisement

x86_64-conda_cos6-linux-gnu-cc: Command not found with postgres function makefile

I am trying to do this tutorial: https://linuxgazette.net/139/peterson.html so I can learn to write postgres functions.

It says to use this makefile, which fails:

JavaScript

Errors:

JavaScript

I have tried several things, including updating conda and anaconda, as per the answers to similar questions. Nothing has worked yet.

How do I compile postgres function given this situation?

Advertisement

Answer

This error has occurred caused by absent GCC compiler((/tmp/build/80754af9/postgresql-split_1552510884761/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc) in your machine. Therefore, you need to rewrite a make rule.

  1. Update the gcc compiler version 6 or later.
  2. Rewrite the Makefile by adding “CC := /usr/bin/gcc” below the line of “include $(PGXS)”.

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) –pgxs)
include $(PGXS)
CC := /usr/bin/gcc 3. Finally, compile your extension. (USE_PGXS=1 make)

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement