pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

please document installation better for devs with other background #182

Closed barbalex closed 4 years ago

barbalex commented 4 years ago

First and foremost: Thanks for this great tool. I would love to use it - it sounds like the perfect match to use wfs services in one of my projects.

The readme says (emphasis and line breaks by me):

To build the wrapper, make sure you have the GDAL library and development packages (is gdal-config on your path?) installed, as well as the PostgreSQL development packages (is pg_config on your path?) Build the wrapper with make and make install. Now you are ready to create a foreign table

This is a lot to digest for a Javascript/Node dev like me. Who has never done any of the four things mentioned here.

It would be very helpful if these four steps would be separated clearly and explained better. For instance:

I first wanted to add the following point. But I realize it is not helpful so I am just including it seperately so you know how hard such installations can be for Javascript/Node devs:

pramsey commented 4 years ago

I'm afraid detailed instructions for folks who don't understand system packaging is a bit beyond the remit of this project. I should perhaps includes some links to the PGDG yum repositories, but that then builds in assumptions like "you're using linux" and even more "you're using the PGDG builds".

There's just too many potential install paths and starting points (I'm on MacOS with HomeBrew, I'm on MacOS with MacPorts, I'm using Debian with the system postgres, I'm using Ubuntu with the PgDG Postgres, I'm using Centos with whatever Postgres I got in the box, I'm using RHEL8, I'm using RHEL6, I'm using Windows (Ironically, Windows despite being the hardest platform to build on is the easiest one to target with a single build variant.))

Anyways, if you want to build from source: (a) build gdal from source and install (b) build postgresql from source and install and (c) build ogr_fdw from source and install.

If none of the above makes sense to you, please appreciate that this low-level extension to PostgreSQL might not be something you can easily access.

(There is no python dependency. Yes, installing python dependencies is also a mortal PITA. I have found that virtualenv makes it less awful, but it's still frightening and awful, and my development laptop is a shambles of half-broken python variants.)

barbalex commented 4 years ago

if you want to build from source

Can I understand that to mean that building from source is not necessary?

I am looking for the most simple way to use pgsql-ogr-fdw.

If none of the above makes sense to you, please appreciate that this low-level extension to PostgreSQL might not be something you can easily access

This may well be the case

I work on Windows (dev) and ubuntu via docker.

Will try the linked windows build.

Is there something like it for ubuntu via docker?

pramsey commented 4 years ago

There's no docker build, I'm not sure such a thing would even be possible.

If you're running Windows PgSQL, then hopefully the windows build will be all you need.

There are certainly RPM builds and deb builds out there, but whether they work with your install of PgSQL is another thing entirely. Running a search for ogr_fdw in your package manager of choice and seeing what happens is recommended.

robe2 commented 4 years ago

FWIW if you are building your dockers using your own Dockerfile, adding the following lines should work:

RUN apt-get install postgresql-12-ogr-fdw

Replace the 12 with whatever version of PostgreSQL you are running. Haven't tested above but should work. If per chance the above doesn't work, you may need to add the apt.postgresql.org repository something like:

RUN wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
RUN add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ $(lsb_release -s -c)-pgdg main 12"

Replace the 12 with whatever version of PostgreSQL you are running.

Examples of postgis/postgresql docker images that might be useful to you - https://github.com/postgis/docker-postgis

I'm actually thinking for these we should package ogr_fdw extension as we've got all dependencies already. I'll add to the wish list of that.

robe2 commented 4 years ago

I feel like we can close this out don't you @pramsey and @barbalex ?

barbalex commented 4 years ago

yep and thanks for great help