CDB_Federated_Table_Register works to refresh a table

This commit is contained in:
Raul Marin
2019-10-30 13:53:56 +01:00
parent f20a007160
commit 28376ffecb
3 changed files with 26 additions and 2 deletions

View File

@@ -88,6 +88,22 @@ Select 'list_remotes2', CDB_Federated_Server_List_Registered_Tables(
remote_schema => 'remote_schema'
);
-- Reregistering R2 with different parameters should work
SELECT 'R3', cartodb.CDB_Federated_Table_Register(
server => 'loopback',
remote_schema => 'remote_schema',
remote_table => 'remote_geom2',
id_column => 'id',
geom_column => 'geom',
local_name => 'different_name'
);
-- The old view should dissapear
SELECT 'S3_old', cartodb_id, ST_AsText(the_geom_webmercator), another_field FROM "myFullTable";
-- And the new appear
SELECT 'S3_new', cartodb_id, ST_AsText(the_geom_webmercator), another_field FROM different_name;
-- Deregistering the first table
SELECT 'U1', CDB_Federated_Table_Unregister(
server => 'loopback',
remote_schema => 'remote_schema',

View File

@@ -17,7 +17,10 @@ V2| SELECT t.id AS cartodb_id,
S2|3|POINT(3 3)|patata
list_remotes2|(remote_geom2,"public.""myFullTable""")
list_remotes2|(remote_geom,public.remote_geom)
R3|
ERROR: relation "myFullTable" does not exist at character 82
S3_new|3|POINT(333958.472379821 334111.17140196)|patata
U1|
ERROR: relation "remote_geom" does not exist at character 71
list_remotes3|(remote_geom2,"public.""myFullTable""")
list_remotes3|(remote_geom2,public.different_name)
D1|