Learn R Programming

pgTools (version 1.0.2)

pg_alterColumnType: Helper command to alter a column's data type via ALTER TABLE.

Description

Helper command to alter a column's data type via ALTER TABLE.

Usage

pg_alterColumnType(column_name, data_type, using = NULL)

Value

A string, PostgreSQL helper statement to alter a column type using ALTER TABLE.

Arguments

column_name

A string, the name of the column to add.

data_type

A string, the data type of the column to add.

using

A string, a command to cast the column into the appropriate type.

Examples

Run this code
pg_alterColumnType(
column_name = "newCol",
data_type = "text"
)

Run the code above in your browser using DataLab