pg_exists_table: Check if 'table_name' exists in the Postgres database of...

View source: R/postgres.R

pg_exists_tableR Documentation

Check if table_name exists in the Postgres database of given con

Description

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

Usage

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


edalfon/efun documentation built on June 23, 2024, 4:17 a.m.