RedShift - Renaming - ALTER TABLE

Rename a table

The following command renames the USERS table to USERS_BKUP:

alter table users
rename to users_bkup;

You can also use this type of command to rename a view.

Change the owner of a table or view

The following command changes the VENUE table owner to the user DWUSER:

alter table venue
owner to dwuser;

Rename a column

The following command renames the VENUESEATS column in the VENUE table to VENUESIZE:

alter table venue
rename column venueseats to venuesize;

Comments

Popular posts from this blog

Recursively Delete files of the Same Name in S3

Python - datetime Formatting

ORACLE RDS granting select privileges to users.