Currently Redshift do not provide privilege to create copy of full schema on same database in Redshift. I followed this(http://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_SCHEMA.html), but did not get any information on my question
Yes, you can use below query to copy your data from one schema to another.
Create table new_schema.table_name as select * from old_schema.table_name.
New contributor
Paras Bashyan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
It sounds like you want to create a copy of all the tables with data. If so then you will have to:
- Create the new schema
- Retrieve the DDL for all tables in existing schema
- Modify the DDL to reference the new schema
- Run the DDL to create the target tables
- Run an
INSERT INTO new_schema.new_table SELECT * FROM old_schema.old_table;
for each table in the schema.
-
1Can you suggest a quicker way or command with less human intervention ? – Vishal786btc Feb 12 '19 at 21:18