Files
cartodb-postgresql/test/CDB_FederatedServerTables_expect

102 lines
4.0 KiB
Plaintext

C1|
## Registering an existing table works
R1|
V1| SELECT t.id AS cartodb_id,
t.geom AS the_geom,
st_transform(t.geom, 3857) AS the_geom_webmercator,
t.another_field
FROM cdb_fs_schema_b904664b5208433cd85a1693ba4f7570.remote_geom t;
S1|1|POINT(1 1)|patata
S1|2|POINT(2 2)|patata2
list_remotes1|(remote_geom,public.remote_geom)
## Registering another existing table works
R2|
V2| SELECT t.id AS cartodb_id,
t.geom AS the_geom,
t.geom_mercator AS the_geom_webmercator,
t.another_field
FROM cdb_fs_schema_b904664b5208433cd85a1693ba4f7570.remote_geom2 t;
S2|3|POINT(3 3)|patata
list_remotes2|(remote_geom2,"public.""myFullTable""")
list_remotes2|(remote_geom,public.remote_geom)
## Re-registering a table works
R3|
ERROR: relation "myFullTable" does not exist at character 70
S3_new|3|POINT(3 3)|patata
## Unregistering works
U1|
ERROR: relation "remote_geom" does not exist at character 71
list_remotes3|(remote_geom2,public.different_name)
## Registering a table: Invalid server fails
ERROR: Server "Does not exist" does not exist
## Registering a table: NULL server fails
ERROR: Server name cannot be NULL
## Registering a table: Invalid schema fails
ERROR: schema "Does not exist" is not present on foreign server "cdb_fs_loopback"
## Registering a table: NULL schema fails
ERROR: Schema name cannot be NULL
## Registering a table: Invalid table fails
ERROR: relation "cdb_fs_schema_b904664b5208433cd85a1693ba4f7570.Does not exist" does not exist
## Registering a table: NULL table fails
ERROR: Remote table name cannot be NULL
## Registering a table: Invalid id fails
ERROR: non integer id_column "Does not exist"
## Registering a table: NULL id fails
ERROR: non integer id_column "<NULL>"
## Registering a table: Invalid geom_column fails
ERROR: non geometry column "Does not exists"
## Registering a table: NULL geom_column is OK
## Registering a table: Invalid webmercator_column fails
ERROR: non geometry column "Does not exists"
## Registering a table: NULL webmercator_column is OK
## Target conflict is handled nicely: Table
CREATE TABLE
ERROR: Could not import table "remote_geom" as "localtable": "localtable" already exists
## Target conflict is handled nicely: View
CREATE VIEW
ERROR: Could not import table "remote_geom" as "localtable2": "localtable2" already exists
DROP VIEW
DROP TABLE
## Registering tables does not work without permissions
You are now connected to database "contrib_regression" as user "cdb_fs_tester".
ERROR: Not enough permissions to access the server "loopback"
## Listing registered tables does not work without permissions
ERROR: Not enough permissions to access the server "loopback"
## Registering tables works with granted permissions
You are now connected to database "contrib_regression" as user "postgres".
You are now connected to database "contrib_regression" as user "cdb_fs_tester".
## Listing registered tables works with granted permissions
(remote_geom2,public.different_name)
(remote_geom,public.localtable)
## Selecting from a registered table with granted permissions works
1|POINT(1 1)
2|POINT(2 2)
## Selecting from a registered table without permissions does not work
You are now connected to database "contrib_regression" as user "cdb_fs_tester2".
ERROR: permission denied for view localtable
## Deleting a registered table without permissions does not work
ERROR: Not enough permissions to access the server "loopback"
## Only the owner can grant permissions over the server
ERROR: You do not have rights to grant access on "loopback"
## Everything works for a different user when granted permissions
You are now connected to database "contrib_regression" as user "postgres".
You are now connected to database "contrib_regression" as user "cdb_fs_tester2".
(remote_geom2,public.different_name)
(remote_geom,public.localtable)
1|POINT(1 1)
2|POINT(2 2)
## A different user can unregister a table
NOTICE: drop cascades to view localtable
(remote_geom2,public.different_name)
## Only the owner can revoke permissions over the server
ERROR: You do not have rights to revoke access on "loopback"
D1|