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

PostgreSQL 11? #48

Closed
ArturFormella opened this issue Nov 4, 2018 · 18 comments
Closed

PostgreSQL 11? #48

ArturFormella opened this issue Nov 4, 2018 · 18 comments
Labels

Comments

@ArturFormella
Copy link

Hello!
I have the following error:

$sudo USE_PGXS=1 pgxn install rum

INFO: best version: rum 1.1.0
INFO: saving /tmp/tmp32u9l4/rum-1.1.0.zip
INFO: unpacking: /tmp/tmp32u9l4/rum-1.1.0.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/rumsort.o src/rumsort.c
In file included from /usr/include/postgresql/11/server/catalog/index.h:18:0,
                 from src/rumsort.c:129:
/usr/include/postgresql/11/server/nodes/execnodes.h:1849:2: error: unknown type name ‘TuplesortInstrumentation’
  TuplesortInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
  ^
In file included from src/rumsort.c:138:0:
/usr/include/postgresql/11/server/utils/probes.h:10:21: fatal error: sys/sdt.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'src/rumsort.o' failed
make: *** [src/rumsort.o] Error 1
ERROR: command returned 2: make PG_CONFIG=/usr/bin/pg_config all

My pg_config:

root@DKXP:/home/a.formella# pg_config
BINDIR = /usr/lib/postgresql/11/bin
DOCDIR = /usr/share/doc/postgresql-doc-11
HTMLDIR = /usr/share/doc/postgresql-doc-11
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/11/server
LIBDIR = /usr/lib/x86_64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/11/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/11/man
SHAREDIR = /usr/share/postgresql/11
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' '--libexecdir=/usr/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-tclconfig=/usr/lib/x86_64-linux-gnu/tcl8.6' '--with-includes=/usr/include/tcl8.6' 'PYTHON=/usr/bin/python' '--mandir=/usr/share/postgresql/11/man' '--docdir=/usr/share/doc/postgresql-doc-11' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/11' '--bindir=/usr/lib/postgresql/11/bin' '--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 11.0-1.pgdg16.04+2)' '--enable-nls' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'TAR=/bin/tar' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' '--with-includes=/usr/include/mit-krb5' '--with-libs=/usr/lib/mit-krb5' '--with-libs=/usr/lib/x86_64-linux-gnu/mit-krb5' 'build_alias=x86_64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
CC = gcc
CPPFLAGS = -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-6.0/lib -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 11.0 (Ubuntu 11.0-1.pgdg16.04+2)
@za-arthur
Copy link
Contributor

Hello,
Yep, this is because pgxn stores old version of RUM, 1.1.0. Current version of RUM is 1.3.0. For now you may try version from GitHub.
@akorotkov maintains distribution RUM through pgxn.

@levin222
Copy link

levin222 commented Nov 8, 2018

@za-arthur
When I try to install from Github
it show that 👍

make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c -o src/rumsort.o src/rumsort.c
In file included from src/rumsort.c:138:0:
/usr/include/postgresql/11/server/utils/probes.h:10:21: fatal error: sys/sdt.h: 没有那个文件或目录
compilation terminated.
: recipe for target 'src/rumsort.o' failed
make: *** [src/rumsort.o] Error 1

@ArturFormella
Copy link
Author

ArturFormella commented Nov 8, 2018

Try
sudo apt-get install systemtap-sdt-dev

@za-arthur
Copy link
Contributor

za-arthur commented Nov 8, 2018

@levin222 , can you try the solution from #27 (comment)?

@levin222
Copy link

levin222 commented Nov 8, 2018

@za-arthur my system is Ubuntu 16.04

after sudo apt-get install systemtap-sdt-dev
It show like that

root@vps01:~/rum# make USE_PGXS=1 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -c -o src/rumsort.o src/rumsort.c
In file included from src/rumsort.c:142:0: src/rum.h:778:2: error: unknown type name ‘RBNode’ RBNode rbnode;
^ : recipe for target 'src/rumsort.o' failed
make: *** [src/rumsort.o] Error 1

@levin222
Copy link

levin222 commented Nov 9, 2018

apt install postgresql 11
by https://tecadmin.net/install-postgresql-server-on-ubuntu/

I try in 2 vps get the same error

@za-arthur
Copy link
Contributor

@levin222 , did you install postgresql-server-dev package?

@andreak
Copy link

andreak commented Nov 9, 2018

FWIW, I get the same error on Kubuntu-cosmic;

$ sudo apt install postgresql-server-dev-11
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql-server-dev-11 is already the newest version (11.1-1.pgdg18.10+1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[andreak@spaceballs-one] ~/dev/rum (master)
$ make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -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/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/rumsort.o src/rumsort.c
In file included from src/rumsort.c:142:
src/rum.h:778:2: error: unknown type name ‘RBNode’
  RBNode  rbnode;
  ^~~~~~
make: *** [<builtin>: src/rumsort.o] Error 1

@za-arthur
Copy link
Contributor

Ok. Thank you! I'll try to understand what happens here.

@za-arthur
Copy link
Contributor

So it was because of renames of structures and functions in rbtree.h for PostgreSQL 10 and 11. See:
postgres/postgres@b2e754c
postgres/postgres@1f28ec6

I pushed a commit which fixes this. I'll ask maintainers of RUM apt package to update it, so it will take time to update the package. For now you can use RUM sources to build instead of the package.

@za-arthur za-arthur added the bug label Nov 9, 2018
@za-arthur
Copy link
Contributor

I wrote to the PostgreSQL mailing list. So will wait:
https://www.postgresql.org/message-id/5e395595-4ab6-d95f-4666-8c9fb0a3d148%40postgrespro.ru

@df7cb
Copy link
Contributor

df7cb commented Nov 9, 2018

1.3.1 works with 11.1, but not with 10.6:

13:15:05 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -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 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I. -I./ -I/usr/include/postgresql/10/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/rumsort.o src/rumsort.c
13:15:05 In file included from src/rumsort.c:142:
13:15:05 src/rum.h:782:2: error: unknown type name 'RBTNode'
13:15:05   RBTNode  rbnode;
13:15:05   ^~~~~~~

@za-arthur
Copy link
Contributor

Hm, interesting. It seems REL_10_6 didn't get those renames, but REL_11_1 got. Maybe REL_10_7 will have different names in rbtree.h, so it is necessary to handle 10.6 and future 10.7 differently.

za-arthur added a commit that referenced this issue Nov 9, 2018
Handle it differently for PostgreSQL 10.6 and 10.7.
@df7cb
Copy link
Contributor

df7cb commented Nov 9, 2018

Fwiw, if you are pushing out an update, tag it as 1.3.2, 1.3.1 has already been uploaded to Debian.

@za-arthur
Copy link
Contributor

za-arthur commented Nov 9, 2018

Yes, I pushed recently tag 1.3.2. It was fixed there.
Thank you!

@df7cb
Copy link
Contributor

df7cb commented Nov 9, 2018

I just checked the PG git tree, 10.7 will indeed have the renames. The renames were meant to be part of 11.2, but due to the "emergency" disabling of the recheck_on_update optimizations, 11.1 got re-tagged so that commit slipped in. Duh.

@za-arthur
Copy link
Contributor

Yeah, understood. It is good that the problem was solved!

@za-arthur
Copy link
Contributor

postgresql-10-rum and postgresql-11-rum packages were updated. Close the issue.

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

No branches or pull requests

5 participants