[openstreetmap/openstreetmap-website] Remove need for shared library PostgreSQL functions (#2383)

Andy Allan notifications at github.com
Wed Oct 9 10:27:30 UTC 2019


gravitystorm approved this pull request.

This is great and I'm all for it. It's not only better for developers, but opens up new installation environments where users might not be able to load/compile shared libraries.

I've added some minor notes on the documentation inline - I'm just trying to streamline the first-install experience for new developers. Additionally:

* I think it's worth adding a line to the "Production Deployment" section of CONFIGURE.md 
* I'd like @tomhughes to confirm if he's happy with this PR too.

> @@ -174,20 +174,12 @@ psql -d openstreetmap -c "CREATE EXTENSION btree_gist"
 
 ### PostgreSQL Functions
 
-We need to install special functions into the PostgreSQL databases, and these are provided by a library that needs compiling first.
+There are special database functions required by a (little-used) API call, the migrations and diff replication. The former two are provided as *either* pure SQL functions or a compiled shared library. It is recommended that you start with the pure SQL versions, as described below, and only install the compiled shared library if you are running a production server making a lot of `/changes` API calls or need the diff replication functionality.

I would suggest rephrasing this to avoid the user from having to read, understand, or make a decision at this point. So for example, I think it's enough to say:

"We need to install some special functions into the PostgreSQL databases"

... and leave it at that. The explanation of the advantages of the compiled shared library can then live in the later section of the docs, and if someone gets that far and wants to use them, it's only a total of 3 lines of code to copy+paste (1 here for installing, 2 later for removing) so no big deal.

> @@ -225,3 +217,42 @@ Note that the OSM map tiles you see aren't created from your local database - th
 # Configuration
 
 After installing this software, you may need to carry out some [configuration steps](CONFIGURE.md), depending on your tasks.
+
+# Installing compiled shared library database functions

Add `(optional)` to this title to highlight (and reassure) that it's not necessary for most people.

> @@ -225,3 +217,42 @@ Note that the OSM map tiles you see aren't created from your local database - th
 # Configuration
 
 After installing this software, you may need to carry out some [configuration steps](CONFIGURE.md), depending on your tasks.
+
+# Installing compiled shared library database functions
+
+You probably only need to do this if you are running a large, production instance of openstreetmap-website.

Additional explanation from above can go here

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2383#pullrequestreview-299310245
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20191009/c7f9883a/attachment.html>


More information about the rails-dev mailing list