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

Adding postgis #44

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Adding postgis #44

wants to merge 7 commits into from

Conversation

lwiechec
Copy link

Hi,

I needed to add support for PostGIS spatial extension, so - here it is.

PS: I really like your Docker image as it make is easy to enable clustering etc. Thanks for it!

Łukasz Wiecheć added 7 commits December 18, 2015 09:49
normally, to enable PostGIS for a database (including template db),
issuing

    CREATE EXTENSION IF NOT EXISTS postgis;

should suffice. However, this is not working in single-user mode (see
http://stackoverflow.com/q/28147177/1547895).

Instead, we are running PostGIS's SQL scripts.
@sameersbn
Copy link
Owner

Thanks for the PR. Will need a little time to review the changes. Please bear.


DB_POSTGIS=${DB_POSTGIS:-false}
DB_POSTGIS_HSTORE=${DB_POSTGIS_HSTORE:-true}
DB_POSTGIS_TOPOLOGY=${DB_POSTGIS_TOPOLOGY:-true}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot see where DB_POSTGIS_HSTORE and DB_POSTGIS_TOPOLOGY variables are used? Did you intend to commit these variables?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sameer,

sorry for sloppiness on my part. I don't know how to fix that in this pull request, so I have created another one.

I decided to drop the hstore extension, as I it looks like it's not a PostGIS specific extension.

@sameersbn
Copy link
Owner

I extended your work from this PR which can be found in the postgis-extension-finalization branch. Here are the changesets.

One important change I have done is that I have removed the use of single-user mode during the setup. The postgres server is now started internally to complete the setup before it is reconfigured to accept external connections. This enables the use of CREATE EXTENSION statement to enable the PostGIS extension among other things.

At the moment, the PG_POSTGIS=true parameter controls the following statements:

CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology

Can you confirm that these are the only two that should be enabled? I have no experience using PostGIS. Can you please review and test the changes in the postgis-extension-finalization branch before it can be merged into the master?

Thank you.

lwiechec pushed a commit to lwiechec/docker-postgresql that referenced this pull request Jan 11, 2016
environment variable DB_POSTGIS_TOPOLOGY controls creation of
'postgis_topology' extension _only_ when user selects PostGIS extension.

refs sameersbn#44
@skwash
Copy link

skwash commented Mar 12, 2016

I just stumbled across this while looking in to building a postgresql container. As basic verification that the postgis stuff works, you could run the following SQL to verify that the extension is indeed installed as a part of your CI tests:

SELECT postgis_full_version();

@kayoubi
Copy link

kayoubi commented Feb 24, 2017

Hi, this seems to be idle for over a year now, any plan to get it merge ?

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

Successfully merging this pull request may close these issues.

4 participants