1

I'm trying to follow the tutorial on PostgreSQL (https://www.postgresql.org/docs/9.5/static/tutorial-sql-intro.html). I'm running version 9.5.7, so I downloaded the corresponding source code and tried

kurt@kurt-ThinkPad:~/Downloads/postgresql-9.5.7/src/tutorial$ make
Makefile:27: /usr/lib/postgresql/9.5/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/9.5/lib/pgxs/src/makefiles/pgxs.mk'.  Stop.

However, it's not able to find certain Makefiles as shown in the error message above. Am I doing anything wrong?

1
  • 1
    You don't really need to "build" them,. The file basics.source is essentially a SQL script. You can just run it - or copy and past the statements. The same is true for advanced.source Commented May 30, 2017 at 10:37

2 Answers 2

2

The problem is that that there is a different pg_config executable in your PATH (probably /usr/lib/postgresql/9.5/bin/pg_config), but that installation does not have the extension development environment PGXS installed.

You can either set your PATH so that the pg_config from your build tree (in Downloads) is found first, or you don't use pg_config at all and build with

make NO_PGXS=1
Sign up to request clarification or add additional context in comments.

Comments

2

I managed to solve the problem by first running

sudo apt-get install postgresql-server-dev-all

After that, the make command runs without error.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.