Uses Postgres' to_regclass, taking advantage of the fact that it will "return null rather than throwing an error if the name is not found" https://www.postgresql.org/docs/10/functions-info.html This is probably the fastest way to test if a table (relation) exists. Alternatives would be querying pg_tables or pg_catalog

pg_exists_table(con, table_name)

Arguments

con

DBI connection to the database

table_name

character with the table name you want to check

Value

boolean