CDB_FederatedServerTables: Improve tests readability
This commit is contained in:
parent
aa481f4219
commit
73ee4107d4
@ -54,6 +54,7 @@ SET client_min_messages TO error;
|
|||||||
\set VERBOSITY terse
|
\set VERBOSITY terse
|
||||||
\set QUIET off
|
\set QUIET off
|
||||||
|
|
||||||
|
\echo '## Registering an existing table works'
|
||||||
SELECT 'R1', cartodb.CDB_Federated_Table_Register(
|
SELECT 'R1', cartodb.CDB_Federated_Table_Register(
|
||||||
server => 'loopback',
|
server => 'loopback',
|
||||||
remote_schema => 'remote_schema',
|
remote_schema => 'remote_schema',
|
||||||
@ -70,6 +71,7 @@ Select 'list_remotes1', CDB_Federated_Server_List_Registered_Tables(
|
|||||||
remote_schema => 'remote_schema'
|
remote_schema => 'remote_schema'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
\echo '## Registering another existing table works'
|
||||||
SELECT 'R2', cartodb.CDB_Federated_Table_Register(
|
SELECT 'R2', cartodb.CDB_Federated_Table_Register(
|
||||||
server => 'loopback',
|
server => 'loopback',
|
||||||
remote_schema => 'remote_schema',
|
remote_schema => 'remote_schema',
|
||||||
@ -88,7 +90,8 @@ Select 'list_remotes2', CDB_Federated_Server_List_Registered_Tables(
|
|||||||
remote_schema => 'remote_schema'
|
remote_schema => 'remote_schema'
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Reregistering R2 with different parameters should work
|
|
||||||
|
\echo '## Re-registering a table works'
|
||||||
SELECT 'R3', cartodb.CDB_Federated_Table_Register(
|
SELECT 'R3', cartodb.CDB_Federated_Table_Register(
|
||||||
server => 'loopback',
|
server => 'loopback',
|
||||||
remote_schema => 'remote_schema',
|
remote_schema => 'remote_schema',
|
||||||
@ -103,6 +106,7 @@ SELECT 'S3_old', cartodb_id, ST_AsText(the_geom), another_field FROM "myFullTabl
|
|||||||
-- And the new appear
|
-- And the new appear
|
||||||
SELECT 'S3_new', cartodb_id, ST_AsText(the_geom), another_field FROM different_name;
|
SELECT 'S3_new', cartodb_id, ST_AsText(the_geom), another_field FROM different_name;
|
||||||
|
|
||||||
|
\echo '## Unregistering works'
|
||||||
-- Deregistering the first table
|
-- Deregistering the first table
|
||||||
SELECT 'U1', CDB_Federated_Table_Unregister(
|
SELECT 'U1', CDB_Federated_Table_Unregister(
|
||||||
server => 'loopback',
|
server => 'loopback',
|
||||||
@ -117,6 +121,18 @@ Select 'list_remotes3', CDB_Federated_Server_List_Registered_Tables(
|
|||||||
remote_schema => 'remote_schema'
|
remote_schema => 'remote_schema'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Try to register with invalid / NULL server
|
||||||
|
-- Try to register with invalid / NULL schema
|
||||||
|
-- Try to register with invalid / NULL table
|
||||||
|
-- Try to register with invalid / NULL id
|
||||||
|
-- Try to register with invalid / NULL geom_column
|
||||||
|
-- Try to register with invalid / NULL webmercator_column
|
||||||
|
-- Try to register the same table twice (different name) should fail
|
||||||
|
-- Check that conflict is handled nicely (target view already exists)
|
||||||
|
|
||||||
|
-- Try permissions tricks
|
||||||
|
|
||||||
|
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Cleanup
|
-- Cleanup
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
C1|
|
C1|
|
||||||
|
## Registering an existing table works
|
||||||
R1|
|
R1|
|
||||||
V1| SELECT t.id AS cartodb_id,
|
V1| SELECT t.id AS cartodb_id,
|
||||||
t.geom AS the_geom,
|
t.geom AS the_geom,
|
||||||
@ -8,6 +9,7 @@ V1| SELECT t.id AS cartodb_id,
|
|||||||
S1|1|POINT(1 1)|patata
|
S1|1|POINT(1 1)|patata
|
||||||
S1|2|POINT(2 2)|patata2
|
S1|2|POINT(2 2)|patata2
|
||||||
list_remotes1|(remote_geom,public.remote_geom)
|
list_remotes1|(remote_geom,public.remote_geom)
|
||||||
|
## Registering another existing table works
|
||||||
R2|
|
R2|
|
||||||
V2| SELECT t.id AS cartodb_id,
|
V2| SELECT t.id AS cartodb_id,
|
||||||
t.geom AS the_geom,
|
t.geom AS the_geom,
|
||||||
@ -17,9 +19,11 @@ V2| SELECT t.id AS cartodb_id,
|
|||||||
S2|3|POINT(3 3)|patata
|
S2|3|POINT(3 3)|patata
|
||||||
list_remotes2|(remote_geom2,"public.""myFullTable""")
|
list_remotes2|(remote_geom2,"public.""myFullTable""")
|
||||||
list_remotes2|(remote_geom,public.remote_geom)
|
list_remotes2|(remote_geom,public.remote_geom)
|
||||||
|
## Re-registering a table works
|
||||||
R3|
|
R3|
|
||||||
ERROR: relation "myFullTable" does not exist at character 70
|
ERROR: relation "myFullTable" does not exist at character 70
|
||||||
S3_new|3|POINT(3 3)|patata
|
S3_new|3|POINT(3 3)|patata
|
||||||
|
## Unregistering works
|
||||||
U1|
|
U1|
|
||||||
ERROR: relation "remote_geom" does not exist at character 71
|
ERROR: relation "remote_geom" does not exist at character 71
|
||||||
list_remotes3|(remote_geom2,public.different_name)
|
list_remotes3|(remote_geom2,public.different_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user