Comment on a table, a view or a schema.
dbComment(
conn,
name,
comment,
type = c("table", "view", "schema"),
display = TRUE,
exec = TRUE
)
A connection object.
A character string specifying a PostgreSQL table, view or schema name.
A character string specifying the comment.
The type of the object to comment, either "table"
, "view"
,
or "schema"
Logical. Whether to display the query (defaults to
TRUE
).
Logical. Whether to execute the query (defaults to
TRUE
).
If exec = TRUE
, returns TRUE
if the comment was
successfully applied.
The PostgreSQL documentation: http://www.postgresql.org/docs/current/static/sql-comment.html
## examples use a dummy connection from DBI package
conn <- DBI::ANSI()
dbComment(conn, name = c("schema", "table"), comment = "Comment on a view.",
type = "view", exec = FALSE)
#> Query not executed:
#> COMMENT ON VIEW "schema"."table" IS 'Comment on a view.';
dbComment(conn, name = "test_schema", comment = "Comment on a schema.", type = "schema",
exec = FALSE)
#> Query not executed:
#> COMMENT ON SCHEMA "test_schema" IS 'Comment on a schema.';