
Update table_idtax (Materialized View Version)
update_taxa_link_table.RdRefreshes the table_idtax materialized view with latest synonym information from the taxa database. This version works with the materialized view approach and can be run by non-admin users with appropriate permissions.
Updates the table_idtax in main database with latest synonym information from the taxa database
Value
List with elements: - success: Logical, TRUE if refresh succeeded - method: Character, "materialized_view" or "legacy" - message: Character, status message - record_count: Integer, number of records after refresh - duration: Numeric, refresh duration in seconds (if available)
NULL (updates database table)
Details
The function first tries to use the PostgreSQL refresh_table_idtax() function (materialized view approach). If that fails, it falls back to the legacy method of updating via dbWriteTable (requires admin permissions).
Author
Gilles Dauby, gilles.dauby@ird.fr
Examples
if (FALSE) { # \dontrun{
# Simple refresh
update_taxa_link_table()
# Force refresh even if recently updated
update_taxa_link_table(force = TRUE)
# With explicit connections
con <- call.mydb()
result <- update_taxa_link_table(con = con)
} # }