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

Support request for pgsql-13.x #24

Closed
Saketha016 opened this issue Apr 8, 2021 · 13 comments
Closed

Support request for pgsql-13.x #24

Saketha016 opened this issue Apr 8, 2021 · 13 comments

Comments

@Saketha016
Copy link

Hi!
As PostgreSQL 13 offers significant improvements in performance and usability, want to know whether any plan to support pgsql-13 version in the future.

@matthewfranglen
Copy link
Owner

Yeah the thing I've been waiting for is a docker image that has multicorn support. The code should work if you're happy to set that up yourself. You can see the pg-13 branch if you want to see what I was trying.

@matthewfranglen
Copy link
Owner

The current postgres:13 docker image is debian 10.9 (buster) while postgresql-13-python3-multicorn is in 11 (sid)

@matthewfranglen
Copy link
Owner

The fdw should work with postgres 13. I'm just not advertising that due to being unable to test it.

@Saketha016
Copy link
Author

Yes, I tried with bitnami/postgresql 13 chart, but no luck, maybe I was missing something there...

But Anyhow. Thanks, Matthew for your quick response.
Looking forward for an update on this from you. :)

@matthewfranglen
Copy link
Owner

Since you have been so nice about this I've had another look. I was able to install the required package from sid onto buster (which is a bad idea in general - I would not recommend this for production use). The fdw does work.

For your specific use case I recommend installing multicorn on the virtual machine. You may have to do it from source. See the documentation for details.

If this resolves your issue then please close this ticket. I may be able to help you if you have trouble setting up the fdw.

@Saketha016
Copy link
Author

Hello Matthew,

I have used Kubernetes to set up postgresql-ha 13.2 version. And as you suggested, I tried installing Multicorn from the source, but It was failing to install and showing up errors.

root@postgresql-postgresql-ha-postgresql-1:/opt# pip --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
root@postgresql-postgresql-ha-postgresql-1:/opt# 
root@postgresql-postgresql-ha-postgresql-1:/opt# python --version
Python 3.7.3
root@postgresql-postgresql-ha-postgresql-1:/opt# 
root@postgresql-postgresql-ha-postgresql-1:/opt# psql --version
psql (PostgreSQL) 13.2
root@postgresql-postgresql-ha-postgresql-1:/opt# 
root@postgresql-postgresql-ha-postgresql-1:/opt# git clone git://github.com/Kozea/Multicorn.git
Cloning into 'Multicorn'...
remote: Enumerating objects: 15733, done.
remote: Total 15733 (delta 0), reused 0 (delta 0), pack-reused 15733
Receiving objects: 100% (15733/15733), 5.93 MiB | 1.26 MiB/s, done.
Resolving deltas: 100% (7607/7607), done.
root@postgresql-postgresql-ha-postgresql-1:/opt# 
root@postgresql-postgresql-ha-postgresql-1:/opt# cd Multicorn/
root@postgresql-postgresql-ha-postgresql-1:/opt/Multicorn# 
root@postgresql-postgresql-ha-postgresql-1:/opt/Multicorn# make && make install
Python version is 3.7
[ -d sql ] || mkdir sql
[ -d src ] || mkdir src
touch directories.stamp
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 -s -fPIC -I/usr/include/python3.7m -I/usr/include/python3.7m  -I. -I./ -I/opt/bitnami/postgresql/include/server -I/opt/bitnami/postgresql/include/internal  -I/opt/bitnami/common/include -I/opt/bitnami/repmgr/include -I/opt/bitnami/postgresql/include -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/errors.o src/errors.c
src/errors.c: In function ‘reportException’:
src/errors.c:71:6: error: too many arguments to function ‘errstart’
  if (errstart(severity, __FILE__, __LINE__, PG_FUNCNAME_MACRO, TEXTDOMAIN))
      ^~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:149:13: note: declared here
 extern bool errstart(int elevel, const char *domain);
             ^~~~~~~~
src/errors.c:73:7: error: too many arguments to function ‘errstart’
   if (errstart(severity, __FILE__, __LINE__, PG_FUNCNAME_MACRO, TEXTDOMAIN))
       ^~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:149:13: note: declared here
 extern bool errstart(int elevel, const char *domain);
             ^~~~~~~~
src/errors.c:84:2: error: too few arguments to function ‘errfinish’
  errfinish(0);
  ^~~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:150:13: note: declared here
 extern void errfinish(const char *filename, int lineno, const char *funcname);
             ^~~~~~~~~
make: *** [<builtin>: src/errors.o] Error 1
root@postgresql-postgresql-ha-postgresql-1:/opt/Multicorn# 

Couldn't figure out what's wrong in the make file. Appreciate your help !!

@matthewfranglen
Copy link
Owner

You could try installing it with pgxn: https://pgxn.github.io/pgxnclient/install.html

pip install pgxnclient
pgxn install multicorn

@Saketha016
Copy link
Author

Sorry Matthew, even "pgxn install multicorn" didn't work:

root@postgresql-postgresql-ha-postgresql-1:/opt/Multicorn# pgxn install multicorn
INFO: best version: multicorn 1.4.0
INFO: saving /tmp/tmpsrg6ilo1/multicorn-1.4.0.zip
INFO: unpacking: /tmp/tmpsrg6ilo1/multicorn-1.4.0.zip
INFO: building extension
Python version is 3.7
[ -d sql ] || mkdir sql
[ -d src ] || mkdir src
touch directories.stamp
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 -s -fPIC -I/usr/include/python3.7m -I/usr/include/python3.7m  -I. -I./ -I/opt/bitnami/postgresql/include/server -I/opt/bitnami/postgresql/include/internal  -I/opt/bitnami/common/include -I/opt/bitnami/repmgr/include -I/opt/bitnami/postgresql/include -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/errors.o src/errors.c
src/errors.c: In function ‘reportException’:
src/errors.c:71:6: error: too many arguments to function ‘errstart’
  if (errstart(severity, __FILE__, __LINE__, PG_FUNCNAME_MACRO, TEXTDOMAIN))
      ^~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:149:13: note: declared here
 extern bool errstart(int elevel, const char *domain);
             ^~~~~~~~
src/errors.c:73:7: error: too many arguments to function ‘errstart’
   if (errstart(severity, __FILE__, __LINE__, PG_FUNCNAME_MACRO, TEXTDOMAIN))
       ^~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:149:13: note: declared here
 extern bool errstart(int elevel, const char *domain);
             ^~~~~~~~
src/errors.c:84:2: error: too few arguments to function ‘errfinish’
  errfinish(0);
  ^~~~~~~~~
In file included from /opt/bitnami/postgresql/include/server/postgres.h:47,
                 from src/multicorn.h:2,
                 from src/errors.c:15:
/opt/bitnami/postgresql/include/server/utils/elog.h:150:13: note: declared here
 extern void errfinish(const char *filename, int lineno, const char *funcname);
             ^~~~~~~~~
make: *** [<builtin>: src/errors.o] Error 1
ERROR: command returned 2: make PG_CONFIG=/opt/bitnami/postgresql/bin/pg_config all
root@postgresql-postgresql-ha-postgresql-1:/opt/Multicorn# 

@matthewfranglen
Copy link
Owner

:(
I'm not sure what you can do. I can't really reproduce that as I don't know what docker image you are using. Maybe you could open a ticket with the multicorn project itself?

https://github.com/Segfault-Inc/Multicorn/issues

... I see you've already done that heh. Good luck!

@Saketha016
Copy link
Author

Yes Matthew, I was about to post that here for ur reference.
Segfault-Inc/Multicorn#261

There seems to be an issue with the Multicorn setup itself. But anyhow will wait for their response. Thanks for ur time, Matthew.

@luss
Copy link

luss commented Apr 10, 2021 via email

@luss
Copy link

luss commented Apr 11, 2021 via email

@matthewfranglen
Copy link
Owner

Thanks to the work of @luss, this ticket can be resolved. The recommended way to install this FDW on PostgreSQL 13+ is to use Multicorn 2. Please review the installation instructions for that repo.

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

3 participants