pg_exists_table | R Documentation |
table_name
exists in the Postgres database of given con
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)
con |
DBI connection to the database |
table_name |
character with the table name you want to check |
boolean
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.