COPY {pgTools} | R Documentation |
Generate a PostgreSQL COPY command, optionally execute the statement if con is not NULL.
Description
Generate a PostgreSQL COPY command, optionally execute the statement if con is not NULL.
Usage
COPY(
schema = NULL,
table,
columns = NULL,
file,
type = "FROM",
delimiter = ",",
format = "csv",
query = NULL,
header = TRUE,
con = NULL
)
Arguments
schema |
A string, the schema of the table to copy from/to. |
table |
A string, the table to copy from/to. |
columns |
A vector, columns to read/write. |
file |
A string, the file path and name to read/write. |
type |
A string, "FROM" or "TO". |
delimiter |
A string, the delimiter. |
format |
A string, "CSV", "TEXT", or "BINARY". |
query |
A string, the query used to select data for output. |
header |
TRUE/FALSE, if TRUE, adds HEADER to statement. |
con |
A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery. |
Value
A string, PostgreSQL COPY command; or the results retrieved by DBI::dbExecute after executing the statement.
Examples
COPY(
table = "table1",
file = "/home/test/test.csv"
)
[Package pgTools version 1.0.2 Index]