User Tools

Site Tools


copy_table_to_another_schema

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
copy_table_to_another_schema [2013/10/02 07:11]
mihael
copy_table_to_another_schema [2013/10/02 07:12] (current)
mihael
Line 7: Line 7:
 <​note>​The INCLUDING keywords are PostgreSQL specific. Regardless of the INCLUDING CONSTRAINTS keywords foreign constraints will not be copied/​created.</​note>​ <​note>​The INCLUDING keywords are PostgreSQL specific. Regardless of the INCLUDING CONSTRAINTS keywords foreign constraints will not be copied/​created.</​note>​
  
 +To copy the contents just use an INSERT statement like this:
 +
 +  INSERT INTO new_schema.my_table SELECT * FROM other_schema.my_table;​
  
 {{tag>​sql}} {{tag>​sql}}
copy_table_to_another_schema.txt ยท Last modified: 2013/10/02 07:12 by mihael