2015-11-12 03:22:59 +08:00
|
|
|
-- Use regular user role
|
|
|
|
SET ROLE test_regular_user;
|
2015-11-24 20:30:18 +08:00
|
|
|
-- Add to the search path the schema
|
2016-02-06 00:57:56 +08:00
|
|
|
SET search_path TO public,cartodb,cdb_dataservices_client;
|
2015-11-12 03:22:59 +08:00
|
|
|
-- Exercise the public function
|
|
|
|
-- it is public, it shall work
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_admin0_polygon('Spain');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_admin0_polygon(3): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_admin0_polygon invoked with params ("test_user", <NULL>, Spain)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_admin0_polygon(username, orgname, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_admin0_polygon(text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_admin0_polygon
|
|
|
|
----------------------------
|
2015-11-12 03:22:59 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_admin1_polygon('California');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_admin1_polygon(3): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_admin1_polygon invoked with params ("test_user", <NULL>, California)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_admin1_polygon(username, orgname, admin1_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_admin1_polygon(text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_admin1_polygon
|
|
|
|
----------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_admin1_polygon('California', 'United States');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_admin1_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_admin1_polygon invoked with params ("test_user", <NULL>, California, United States)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_admin1_polygon(username, orgname, admin1_name, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_admin1_polygon(text,text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_admin1_polygon
|
|
|
|
----------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_namedplace_point('Elx');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_namedplace_point(3): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_namedplace_point invoked with params ("test_user", <NULL>, Elx)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_namedplace_point(username, orgname, city_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_namedplace_point
|
|
|
|
------------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_namedplace_point(4): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_namedplace_point invoked with params ("test_user", <NULL>, Elx, Valencia)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_namedplace_point(username, orgname, city_name, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text,text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_namedplace_point
|
|
|
|
------------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia', 'Spain');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_namedplace_point(5): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_namedplace_point invoked with params ("test_user", <NULL>, Elx, Valencia, Spain)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_namedplace_point(username, orgname, city_name, admin1_name, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_namedplace_point(text,text,text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_namedplace_point
|
|
|
|
------------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_postalcode_polygon('03204', 'Spain');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_postalcode_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_postalcode_polygon invoked with params ("test_user", <NULL>, 03204, Spain)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_postalcode_polygon(username, orgname, postal_code, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_postalcode_polygon(text,text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_postalcode_polygon
|
|
|
|
--------------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_postalcode_point('03204', 'Spain');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_postalcode_point(4): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_postalcode_point invoked with params ("test_user", <NULL>, 03204, Spain)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_postalcode_point(username, orgname, postal_code, country_name)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_postalcode_point(text,text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_postalcode_point
|
|
|
|
------------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_ipaddress_point('8.8.8.8');
|
2016-02-06 00:57:56 +08:00
|
|
|
NOTICE: cdb_dataservices_client._cdb_geocode_ipaddress_point(3): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.cdb_geocode_ipaddress_point invoked with params ("test_user", <NULL>, 8.8.8.8)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_dataservices_client._cdb_geocode_ipaddress_point(username, orgname, ip_address)"
|
2015-12-03 18:03:10 +08:00
|
|
|
PL/pgSQL function cdb_geocode_ipaddress_point(text) line 15 at SQL statement
|
2015-11-24 20:30:18 +08:00
|
|
|
cdb_geocode_ipaddress_point
|
|
|
|
-----------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-12 03:22:59 +08:00
|
|
|
-- Check the regular user has no permissions on private functions
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_admin0_polygon('evil_user', 'evil_orgname', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_admin0_polygon
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', 'evil_orgname', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_admin1_polygon
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', 'evil_orgname', 'Sheol', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_admin1_polygon
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', 'evil_orgname', 'Sheol');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', 'evil_orgname', 'Sheol', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', 'evil_orgname', 'Sheol', 'Hell', 'Ugly world');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_namedplace_point
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_postalcode_polygon('evil_user', 'evil_orgname', '66666', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_postalcode_polygon
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_postalcode_point('evil_user', 'evil_orgname', '66666', 'Hell');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_postalcode_point
|
2015-12-03 18:03:10 +08:00
|
|
|
SELECT _cdb_geocode_ipaddress_point('evil_user', 'evil_orgname', '8.8.8.8');
|
2015-11-24 20:30:18 +08:00
|
|
|
ERROR: permission denied for function _cdb_geocode_ipaddress_point
|