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 sharedir seems incorrect #395

Closed
sphrak opened this issue Dec 29, 2017 · 2 comments
Closed

Postgresql sharedir seems incorrect #395

sphrak opened this issue Dec 29, 2017 · 2 comments

Comments

@sphrak
Copy link

sphrak commented Dec 29, 2017

Hi,
I have spent several hours today trying to use postgis extension along with the postgres:10.1-alpine docker image. Everything works - except using the postgis extension. To me it seems like the alpinelinux ecosystem expects/looks for extensions in /usr/share/postgresql/ - where as the postgres image appears to set the SHAREDIR to /usr/local/share/postgresql/ which eventually leads to this problem:

CREATE EXTENSION IF NOT EXIST postgis;
ERROR:  could not open extension control file "/usr/local/share/postgresql/extension/postgis.control": No such file or directory

.. when installing packages from the alpinelinux repo's.

pg_config

BINDIR = /usr/local/bin
DOCDIR = /usr/local/share/doc/postgresql
HTMLDIR = /usr/local/share/doc/postgresql
INCLUDEDIR = /usr/local/include
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/share/locale
MANDIR = /usr/local/share/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=x86_64-linux-musl' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-tap-tests' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--prefix=/usr/local' '--with-includes=/usr/local/include' '--with-libraries=/usr/local/lib' '--with-openssl' '--with-libxml' '--with-libxslt' 'build_alias=x86_64-linux-musl'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2
CFLAGS_SL = -fPIC
LDFLAGS = -L../../src/common -L/lib -L/usr/local/lib -Wl,--as-needed
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lssl -lcrypto -lz -ledit -lm  
VERSION = PostgreSQL 10.1

Can anyone confirm that this is an issue?

@yosifkit
Copy link
Member

The postgres contained in the alpine-based image is compiled from upstream's released source:

&& wget -O postgresql.tar.bz2 "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" \

And as such, will probably not be compatible with packages installed from alpine's repos. In order to use postgis in the alpine based image, I see three options:

@sphrak
Copy link
Author

sphrak commented Jan 2, 2018

Thanks for clearing this up. I have since solved it by using the alpine base image - and install from the repository instead and those packages works as I'd expected it.

Regards

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

2 participants