Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: "postgres.h not found" #17

Closed
slavitch opened this issue Feb 16, 2021 · 5 comments
Closed

error: "postgres.h not found" #17

slavitch opened this issue Feb 16, 2021 · 5 comments

Comments

@slavitch
Copy link

slavitch commented Feb 16, 2021

brew install timescaledb
==> Installing timescaledb from timescale/tap
==> Downloading https://timescalereleases.blob.core.windows.net/homebrew/timescaledb-2.0.1.tar.lzma
Already downloaded: /Users/michael/Library/Caches/Homebrew/downloads/86a311958704c9e6161d1c81bf3816fde00fbd697c961ca015d0ad2283788a8a--timescaledb-2.0.1.tar.lzma
==> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD="brew"
==> cd ./build && make
Last 15 lines from /Users/michael/Library/Logs/Homebrew/timescaledb/02.build:
/tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/process_utility.c:6:10: error: 'postgres.h' file not found [clang-diagnostic-error]
#include <postgres.h>
^
2 errors generated.
Error while processing /tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/process_utility.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/process_utility.c.o] Error 1
error: unknown warning option '-Wno-format-truncation' [clang-diagnostic-unknown-warning-option]
/tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/planner.c:6:10: error: 'postgres.h' file not found [clang-diagnostic-error]
#include <postgres.h>
^
2 errors generated.
Error while processing /tmp/timescaledb-20210216-34647-w9na0y/timescaledb/tsl/src/planner.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/planner.c.o] Error 1
make[1]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/all] Error 2
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/timescale/homebrew-tap/issues

@volvo007
Copy link

Those files (such as postgres.h, libpq-fe.h, etc.) would act as the library for the code compiling.
timescaledb will look for those files under /usr/local/Cellar/postgresql@12/12.6/include/server if you installed the postgresql through brew (assume you installed postgresql 12.6)

However, those files are actually under /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server.

So try ln -s /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server /usr/local/Cellar/postgresql@12/12.6/include/server this commend mentioned in this issue and check if the compiling works.

Hope this could help.

@DeepakKapiswe
Copy link

This post helped me to resolve similar issue of missing postgres.h file

@jonatas
Copy link
Contributor

jonatas commented Oct 5, 2022

Similar to #16, now we're reinforcing Postgresql@14 for development introduced on #24.

@jonatas jonatas closed this as completed Oct 5, 2022
@vkaragounis
Copy link

Hello, i 've got the same issue in my ubuntu system (20.04) trying to compile (make) the source code
"timescaledb/src/uuid.c:6:10: fatal error: postgres.h: No such file or directory"
Can you please provide me a fix for this issue.
Thank you

@jonatas
Copy link
Contributor

jonatas commented Oct 23, 2023

  • Hey @vkaragounis , as we mentioned in the previous command you should be on PG 14 at least to fix the error. Are you using homebrew on linux or trying to mimic the steps?

If you update and still got the error, please open another issue describing your context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants