View source: R/all_db_wrapper_fns.R
dbDrop | R Documentation |
Drop a table, a view or a schema.
dbDrop(
conn,
name,
type = c("table", "schema", "view", "materialized view"),
ifexists = FALSE,
cascade = FALSE,
display = TRUE,
exec = TRUE
)
conn |
A connection object. |
name |
A character string specifying a PostgreSQL table, schema, or view name. |
type |
The type of the object to drop, either |
ifexists |
Do not throw an error if the object does not exist. A notice is issued in this case. |
cascade |
Automatically drop objects that depend on the object (such as views). |
display |
Logical. Whether to display the query (defaults to
|
exec |
Logical. Whether to execute the query (defaults to
|
If exec = TRUE
, returns TRUE
if the table/schema/view
was successfully dropped.
Mathieu Basille mathieu@basille.org
The PostgreSQL documentation: http://www.postgresql.org/docs/current/static/sql-droptable.html, http://www.postgresql.org/docs/current/static/sql-dropview.html, http://www.postgresql.org/docs/current/static/sql-dropschema.html
## examples use a dummy connection from DBI package
conn <- DBI::ANSI()
dbDrop(conn, name = c("schema", "view_name"), type = "view", exec = FALSE)
dbDrop(conn, name = "test_schema", type = "schema", cascade = "TRUE", exec = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.