2015-11-11 22:38:18 +08:00
|
|
|
-- Check that the public function is callable, even with no data
|
|
|
|
-- It should return NULL
|
2018-09-10 18:54:37 +08:00
|
|
|
SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0');
|
2015-11-11 22:38:18 +08:00
|
|
|
|
|
|
|
-- Insert dummy data into ip_address_locations
|
2015-11-12 00:48:08 +08:00
|
|
|
INSERT INTO ip_address_locations VALUES ('::ffff:0.0.0.0'::inet, (ST_SetSRID(ST_MakePoint('40.40', '3.71'), 4326)));
|
2015-11-11 22:38:18 +08:00
|
|
|
|
|
|
|
-- This should return the polygon inserted above
|
2018-09-10 18:54:37 +08:00
|
|
|
SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0');
|
2015-11-23 18:48:24 +08:00
|
|
|
|
|
|
|
-- Check for namedplaces signatures (point and polygon)
|
|
|
|
SELECT exists(SELECT *
|
|
|
|
FROM pg_proc p
|
|
|
|
INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid)
|
2016-02-06 00:57:22 +08:00
|
|
|
WHERE ns.nspname = 'cdb_dataservices_server'
|
2015-11-24 20:30:18 +08:00
|
|
|
AND proname = 'cdb_geocode_ipaddress_point'
|
2018-09-10 19:15:19 +08:00
|
|
|
AND oidvectortypes(p.proargtypes) = 'text, text, text');
|
2015-11-23 18:48:24 +08:00
|
|
|
|
|
|
|
SELECT exists(SELECT *
|
|
|
|
FROM pg_proc p
|
|
|
|
INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid)
|
2016-02-06 00:57:22 +08:00
|
|
|
WHERE ns.nspname = 'cdb_dataservices_server'
|
2015-11-24 20:30:18 +08:00
|
|
|
AND proname = '_cdb_geocode_ipaddress_point'
|
2016-02-06 00:57:22 +08:00
|
|
|
AND oidvectortypes(p.proargtypes) = 'text');
|