2015-11-12 03:22:59 +08:00
|
|
|
-- Use regular user role
|
|
|
|
SET ROLE test_regular_user;
|
|
|
|
-- Exercise the public function
|
|
|
|
-- it is public, it shall work
|
2015-11-17 18:30:25 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_admin0_polygon('Spain');
|
|
|
|
NOTICE: cdb_geocoder_client._geocode_admin0_polygon(3): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_admin0_polygon invoked with params (postgres, some_transaction_id, Spain)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_admin0_polygon(session_user, txid_current(), country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_admin0_polygon(text) line 5 at SQL statement
|
|
|
|
geocode_admin0_polygon
|
|
|
|
------------------------
|
2015-11-12 03:22:59 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-13 19:32:36 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_admin1_polygon('California');
|
2015-11-17 18:30:25 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_admin1_polygon(3): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_admin1_polygon invoked with params (postgres, some_transaction_id, California)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_admin1_polygon(session_user, txid_current(), admin1_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_admin1_polygon(text) line 5 at SQL statement
|
|
|
|
geocode_admin1_polygon
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT cdb_geocoder_client.geocode_admin1_polygon('California', 'United States');
|
2015-11-17 18:30:25 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_admin1_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_admin1_polygon invoked with params (postgres, some_transaction_id, California, United States)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_admin1_polygon(session_user, txid_current(), admin1_name, country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_admin1_polygon(text,text) line 5 at SQL statement
|
|
|
|
geocode_admin1_polygon
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx');
|
2015-11-17 18:30:25 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_namedplace_point(3): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_namedplace_point invoked with params (postgres, some_transaction_id, Elx)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_namedplace_point(session_user, txid_current(), city_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_namedplace_point(text) line 5 at SQL statement
|
|
|
|
geocode_namedplace_point
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx', 'Valencia');
|
2015-11-17 18:30:25 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_namedplace_point(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_namedplace_point invoked with params (postgres, some_transaction_id, Elx, Valencia)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_namedplace_point(session_user, txid_current(), city_name, country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_namedplace_point(text,text) line 5 at SQL statement
|
|
|
|
geocode_namedplace_point
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx', 'Valencia', 'Spain');
|
2015-11-17 18:30:25 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_namedplace_point(5): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_namedplace_point invoked with params (postgres, some_transaction_id, Elx, Valencia, Spain)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_namedplace_point(session_user, txid_current(), city_name, admin1_name, country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_namedplace_point(text,text,text) line 5 at SQL statement
|
|
|
|
geocode_namedplace_point
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT cdb_geocoder_client.geocode_postalcode_polygon('03204', 'Spain');
|
2015-11-17 19:26:18 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_postalcode_polygon(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_postalcode_polygon invoked with params (postgres, some_transaction_id, 03204, Spain)
|
2015-11-13 19:32:36 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_postalcode_polygon(session_user, txid_current(), postal_code, country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_postalcode_polygon(text,text) line 5 at SQL statement
|
|
|
|
geocode_postalcode_polygon
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-13 20:04:46 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_postalcode_point('03204', 'Spain');
|
2015-11-19 02:09:39 +08:00
|
|
|
NOTICE: cdb_geocoder_client._geocode_postalcode_point(4): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_postalcode_point invoked with params (postgres, some_transaction_id, 03204, Spain)
|
2015-11-13 20:04:46 +08:00
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_postalcode_point(session_user, txid_current(), postal_code, country_name)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_postalcode_point(text,text) line 5 at SQL statement
|
|
|
|
geocode_postalcode_point
|
|
|
|
--------------------------
|
2015-11-13 19:32:36 +08:00
|
|
|
|
|
|
|
(1 row)
|
|
|
|
|
2015-11-17 19:26:18 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_ipaddress_point('8.8.8.8');
|
|
|
|
NOTICE: cdb_geocoder_client._geocode_ipaddress_point(3): [contrib_regression] REMOTE NOTICE: cdb_geocoder_server.geocode_ipaddress_point invoked with params (postgres, some_transaction_id, 8.8.8.8)
|
|
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_ipaddress_point(session_user, txid_current(), ip_address)"
|
|
|
|
PL/pgSQL function cdb_geocoder_client.geocode_ipaddress_point(text) line 5 at SQL statement
|
|
|
|
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-11-17 18:30:25 +08:00
|
|
|
SELECT cdb_geocoder_client._geocode_admin0_polygon('evil_user', 666, 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_admin0_polygon
|
2015-11-13 19:32:36 +08:00
|
|
|
SELECT cdb_geocoder_client._geocode_admin1_polygon('evil_user', 666, 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_admin1_polygon
|
|
|
|
SELECT cdb_geocoder_client._geocode_admin1_polygon('evil_user', 666, 'Sheol', 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_admin1_polygon
|
|
|
|
SELECT cdb_geocoder_client._geocode_namedplace_point('evil_user', 666, 'Sheol');
|
|
|
|
ERROR: permission denied for function _geocode_namedplace_point
|
|
|
|
SELECT cdb_geocoder_client._geocode_namedplace_point('evil_user', 666, 'Sheol', 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_namedplace_point
|
|
|
|
SELECT cdb_geocoder_client._geocode_namedplace_point('evil_user', 666, 'Sheol', 'Hell', 'Ugly world');
|
|
|
|
ERROR: permission denied for function _geocode_namedplace_point
|
|
|
|
SELECT cdb_geocoder_client._geocode_postalcode_polygon('evil_user', 666, '66666', 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_postalcode_polygon
|
2015-11-13 20:04:46 +08:00
|
|
|
SELECT cdb_geocoder_client._geocode_postalcode_point('evil_user', 666, '66666', 'Hell');
|
|
|
|
ERROR: permission denied for function _geocode_postalcode_point
|
2015-11-17 19:26:18 +08:00
|
|
|
SELECT cdb_geocoder_client._geocode_ipaddress_point('evil_user', 666, '8.8.8.8');
|
|
|
|
ERROR: permission denied for function _geocode_ipaddress_point
|