table_name
exists in the Postgres database of given con
R/postgres.R
pg_exists_table.Rd
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)
DBI connection to the database
character with the table name you want to check
boolean