CDB_Federated_Table_Register: Handle conflict nicely

This commit is contained in:
Raul Marin
2019-11-05 16:53:25 +01:00
parent e2beefdb53
commit c9b01592e7
3 changed files with 35 additions and 6 deletions

View File

@@ -186,7 +186,10 @@ BEGIN
array_to_string(carto_columns_expression || rest_of_cols, ','),
src_table
);
EXCEPTION WHEN OTHERS THEN
EXCEPTION
WHEN insufficient_privilege THEN
RAISE EXCEPTION 'Could not import table "%" as "%": "%" already exists', remote_table, local_name, local_name;
WHEN OTHERS THEN
RAISE EXCEPTION 'Could not import table "%" as "%": %', remote_table, local_name, SQLERRM;
END;