Skip to content

Conversation

@theo-brown
Copy link

When building from source, I got the error
Error: pg_config executable not found.
The solution was here - I needed to install an extra package, libpq-dev.
I added this to the 'Building from Source' instructions in the documentation.

@elprans
Copy link
Member

elprans commented Aug 9, 2021

Building from source doesn't require any PostgreSQL components, but running tests does. We already say that "[i]f you want to run tests you must have PostgreSQL installed" in the corresponding section.

@theo-brown
Copy link
Author

Yes, that is true! Should I move it to the section about tests? Or is it not worth including at all.

@elprans
Copy link
Member

elprans commented Aug 9, 2021

Or is it not worth including at all

I think a vague "install Postgres" here is better than trying to explicitly specify a way to install on a specific OS/distro and leaving out the others. That said, feel free to submit a PR improving the error message. Something like Error: pg_config executable could not be found. Please make sure PostgreSQL is installed and its executables are in PATH.

@theo-brown
Copy link
Author

Hm ok, I see your point. My problem was that I had installed Postgresql but not libpq-dev, and thought that might be worth highlighting for others.
Perhaps a vague "install PostgreSQL and PostgreSQL development headers"? What do you think?

@elprans
Copy link
Member

elprans commented Aug 10, 2021

I had installed Postgresql but not libpq-dev

I'm not sure why that SO thread mentions libpq-dev, and why installing it worked for you. pg_ctl is provided by the server PostgreSQL package, whereas libpq-dev does no such thing. Your issue might stem from the fact that pg_ctl doesn't get added to PATH on Debian, so you need to set PATH or, PGINSTALLATION to /usr/lib/postgresql/11/bin/ or whatever is the location for server binaries.

@theo-brown
Copy link
Author

theo-brown commented Aug 10, 2021

I think you might have missed the fact that I was talking about two executables that are required: pg_ctl (from postgresql) and pg_config (from libpq-dev). The SO thread is about pg_config missing.
In my commit, I added that both are required.

@elprans
Copy link
Member

elprans commented Aug 10, 2021

Oh pg_config comes from postgresql-common, which is a dependency of postgresql.

@theo-brown
Copy link
Author

theo-brown commented Aug 10, 2021

Huh, ok. Sounds like I just messed up my package management! Thanks for your feedback :)

@theo-brown theo-brown closed this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants