dropTABLE: Generate a PostgreSQL DROP TABLE statement, optionally...

View source: R/pgTools.R

dropTABLER Documentation

Generate a PostgreSQL DROP TABLE statement, optionally execute the statement if con is not NULL.

Description

Generate a PostgreSQL DROP TABLE statement, optionally execute the statement if con is not NULL.

Usage

dropTABLE(
  name,
  if_exists = FALSE,
  cascade = FALSE,
  restrict = FALSE,
  con = NULL
)

Arguments

name

A string, the "name" parameter for PostgreSQL DROP TABLE.

if_exists

TRUE/FALSE, if TRUE, adds "IF EXISTS" to PostgreSQL DROP TABLE statement.

cascade

TRUE/FALSE, if TRUE, adds "CASCADE" to PostgreSQL DROP TABLE statement.

restrict

TRUE/FALSE, if TRUE, adds "RESTRICT" to PostgreSQL DROP TABLE statement.

con

A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery.

Value

A string, PostgreSQL DROP TABLE statement; or the results retrieved by DBI::dbSendQuery after executing the statement.

Examples

dropTABLE("sample")

pgTools documentation built on March 31, 2023, 7:56 p.m.

Related to dropTABLE in pgTools...