arkhipov / temporal_tables

Temporal Tables PostgreSQL Extension
BSD 2-Clause "Simplified" License
927 stars 46 forks source link

temporal_tables installation failed with PG 13 docker image #58

Open srsonawane opened 2 years ago

srsonawane commented 2 years ago

Does pgxn support PG 12/13 versions? I am not able add this extension. It woks fine with PG10. root@docker-pg-master:/# git clone https://github.com/arkhipov/temporal_tables.git
Cloning into 'temporal_tables'...
remote: Enumerating objects: 271, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 271 (delta 1), reused 10 (delta 1), pack-reused 259
Receiving objects: 100% (271/271), 89.59 KiB | 1.05 MiB/s, done.
Resolving deltas: 100% (157/157), done.
root@docker-pg-master:/temporal_tables# make gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o temporal_tables.o temporal_tables.c
temporal_tables.c:9:10: fatal error: postgres.h: No such file or directory
9 | #include "postgres.h" | ^~~~ compilation terminated. make: *** [: temporal_tables.o] Error 1

Tried using command $pgxn install temporal_tables But getting the same error

Using postgres:13.5-bullseye image.

faatihi commented 2 years ago

I encountered same error with pg10

Running this resolved it: sudo apt-get install postgresql-server-dev-10 postgresql-contrib-10 libpq-dev

I cant tell which of the packages fixed it but I feel its libpq-dev. If that's the case, you can leave out the other packages and only install libpq-dev.

Also remember to change the 10 to your preferred postgres version.

And then installing temporal_tables should be successful: sudo pgxn install temporal_tables

faatihi commented 2 years ago

Okay, I looked at my most recent installed packages using this command on Ubuntu: grep installed /var/log/dpkg.log

Only postgresql-server-dev-10 shows up in the list for today's installed packages. libpq-dev was already installed yesterday. I couldn't find postgresql-contrib-10 in the list.

Based on this, I think installing only postgresql-server-dev-10 would fix this issue.

arkhipov commented 1 year ago

Is it still reproducible with the latest master?