Description Usage Arguments References Examples
View source: R/db_tables_managment.R
Drop tables from a PostgreSQL database matching a pattern with CASCADE.
1 | pgDropTables(conn, pattern, verbose = TRUE)
|
conn |
a PostgreSQLConnection object. |
pattern |
character; string pattern matching tables names . |
verbose |
boolean; whether or not drop message must be printed. |
https://stackoverflow.com/questions/4202135/how-to-drop-multiple-tables-in-postgresql-using-a-wildcard
1 2 3 4 5 6 7 8 | library(RPostgreSQL)
data(mtcars)
conn = dbConnect(drv=dbDriver("PostgreSQL"), host="localhost", port=5432,
dbname="foodflows", user="milo", password="postgres")
dbWriteTable(conn, "mtcars", mtcars, overwrite=TRUE)
dbWriteTable(conn, "mtcars2", mtcars, overwrite=TRUE)
pgDropTables(conn, "cars") # Will drop the 2
dbDisconnect(conn)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.