Accept PG9.5 and PG10 permission error messages
This commit is contained in:
@@ -319,7 +319,22 @@ Select cartodb_id, ST_AsText(the_geom) from localtable;
|
|||||||
|
|
||||||
\echo '## Selecting from a registered table without permissions does not work'
|
\echo '## Selecting from a registered table without permissions does not work'
|
||||||
\c contrib_regression cdb_fs_tester2
|
\c contrib_regression cdb_fs_tester2
|
||||||
Select cartodb_id, ST_AsText(the_geom) from localtable;
|
CREATE OR REPLACE FUNCTION catch_permission_error(query text)
|
||||||
|
RETURNS bool
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
EXECUTE query;
|
||||||
|
RETURN FALSE;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN insufficient_privilege THEN
|
||||||
|
RETURN TRUE;
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
RAISE WARNING 'Exception %', sqlstate;
|
||||||
|
RETURN FALSE;
|
||||||
|
END
|
||||||
|
$$ LANGUAGE 'plpgsql';
|
||||||
|
Select catch_permission_error($$SELECT cartodb_id, ST_AsText(the_geom) from localtable$$);
|
||||||
|
DROP FUNCTION catch_permission_error(text);
|
||||||
|
|
||||||
\echo '## Deleting a registered table without permissions does not work'
|
\echo '## Deleting a registered table without permissions does not work'
|
||||||
SELECT CDB_Federated_Table_Unregister(
|
SELECT CDB_Federated_Table_Unregister(
|
||||||
|
|||||||
@@ -79,7 +79,9 @@ You are now connected to database "contrib_regression" as user "cdb_fs_tester".
|
|||||||
2|POINT(2 2)
|
2|POINT(2 2)
|
||||||
## Selecting from a registered table without permissions does not work
|
## Selecting from a registered table without permissions does not work
|
||||||
You are now connected to database "contrib_regression" as user "cdb_fs_tester2".
|
You are now connected to database "contrib_regression" as user "cdb_fs_tester2".
|
||||||
ERROR: permission denied for view localtable
|
CREATE FUNCTION
|
||||||
|
t
|
||||||
|
DROP FUNCTION
|
||||||
## Deleting a registered table without permissions does not work
|
## Deleting a registered table without permissions does not work
|
||||||
ERROR: Not enough permissions to access the server "loopback"
|
ERROR: Not enough permissions to access the server "loopback"
|
||||||
## Only the owner can grant permissions over the server
|
## Only the owner can grant permissions over the server
|
||||||
|
|||||||
Reference in New Issue
Block a user