Learn R Programming

pgTools (version 1.0.2)

alterSCHEMA: Generate a PostgreSQL ALTER SCHEMA statement, optionally execute the statement if con is not NULL.

Description

Generate a PostgreSQL ALTER SCHEMA statement, optionally execute the statement if con is not NULL.

Usage

alterSCHEMA(name, rename_to = NULL, owner_to = NULL, con = NULL)

Value

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

Arguments

name

A string, the "name" parameter for PostgreSQL ALTER SCHEMA.

rename_to

A string, the "new_name" parameter for PostgreSQL ALTER SCHEMA.

owner_to

A string, the "new_owner" parameter for PostgreSQL ALTER SCHEMA.

con

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

Examples

Run this code
alterSCHEMA("dev", rename_to = "prod")

Run the code above in your browser using DataLab