First try at moving admin1 to merged extension

This commit is contained in:
Rafa de la Torre
2015-11-03 16:03:44 +01:00
parent a9292f6842
commit ddd66aff08
9 changed files with 9 additions and 57 deletions

View File

@@ -1,3 +0,0 @@
results/
regression.diffs
regression.out

View File

@@ -1,8 +0,0 @@
EXTENSION = cdb_geocoder_admin1
DATA = cdb_geocoder_admin1--0.0.1.sql
REGRESS = cdb_geocoder_admin1_test
# postgres build stuff
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

View File

@@ -1,36 +0,0 @@
# CartoDB admin1 geocoder extension
Postgres extension for the CartoDB admin1 geocoder. It is meant to contain the functions and related objects needed to geocode by admin1 regions. It is not meant to contain the actual data used to geocode them.
## Dependencies
This extension is thought to be used on top of CartoDB platform. Therefore a cartodb user is required to install the extension onto it.
The following is a non-comprehensive list of dependencies:
- Postgres 9.3+
- Postgis extension
- Schema triggers extension
- CartoDB extension
## Installation into the db cluster
This requires root privileges
```
sudo make all install
```
## Execute tests
```
PGUSER=postgres make installcheck
```
## Install onto a user's database
```
psql -U development_cartodb_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f cartodb_dev_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f_db
```
and then:
```sql
CREATE EXTENSION cdb_geocoder_admin1;
```
The extension creation in the user's db does not require special privileges. It can be even created from the sql api.

View File

@@ -1,6 +0,0 @@
# cdb geocoder admin1 extension
comment = 'CartoDB admin1 internal geocoder'
default_version = '0.0.1'
relocatable = true
requires = cartodb
superuser = false

View File

@@ -4,7 +4,9 @@ EXTENSION = cdb_geocoder
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
DATA = $(EXTENSION)--$(EXTVERSION).sql
REGRESS = cdb_geocoder_admin0_test
REGRESS = \
cdb_geocoder_admin0_test \
cdb_geocoder_admin1_test
# postgres build stuff
PG_CONFIG = pg_config

View File

@@ -22,6 +22,12 @@ sudo make all install
PGUSER=postgres make installcheck
```
## Build, install & test
One-liner:
```
sudo PGUSER=postgres make all install installcheck
```
## Install onto a user's database
```
psql -U development_cartodb_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f cartodb_dev_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f_db

View File

@@ -1,6 +1,3 @@
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION cdb_geocoder_admin1" to load this file. \quit
-- Response types for admin1 geocoder
-- TODO: check if the types exist already in the db