The following steps below demonstrate the process of moving a table from one schema to another. In the example SQL statements provided, replace source_schema
, my_table
, and target_schema
with your own values.
- Create a duplicate of a table from your source schema to your target schema.
CREATE TABLE "target_schema"."my_table" (LIKE "source_schema"."my_table");
- Populate the new table by moving data from the existing source table.
ALTER TABLE "target_schema"."my_table" APPEND FROM "source_schema"."my_table";
- Drop the source table.
DROP TABLE "source_schema"."my_table";
The ALTER TABLE APPEND
SQL command is usually much faster than a similar CREATE TABLE AS
or INSERT INTO
operation because data is moved, not duplicated.
The Creating schemas article provides information on creating and working with schemas in Panoply.
NOTE:
Moving a table to a different schema will not change the destination schema of a Panoply data source or external integrations.
In Panoply, you cannot change the schema of a data source that has already collected data. If you really need to use a different schema, just create a new data source similar to your old one, and then configure it to use a different schema to import your data to.
Comments
0 comments
Please sign in to leave a comment.