This commit is contained in:
andrewxhill 2014-09-20 00:08:00 +02:00
parent cf609dbac9
commit a55632d779
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,12 @@
Available Services
===============
### Function
Can be used to lookup available services by country name. Example,
```sql
SELECT (admin0_available_services(Array['United States', 'ESP'])).*
```
The functions in sql/build_services_table.sql should be run after any postalcode update.

View File

@ -1,6 +1,9 @@
--CREATE TYPE available_services_v1 AS (q TEXT, adm0_a3 TEXT, postal_code_points BOOLEAN, postal_code_polygons BOOLEAN);
CREATE OR REPLACE FUNCTION admin0_available_services(countries text[])
--EXAMPLE
-- SELECT (admin0_available_services(Array['United States', 'ESP'])).*
CREATE OR REPLACE FUNCTION admin0_available_services(name text[])
RETURNS SETOF available_services_v1 AS $$
DECLARE
ret available_services_v1%rowtype;