Updated on 2024-07-19 GMT+08:00

ALTER TABLE RENAME

GaussDB(DWS) prohibits including schema names in the rename clause, therefore, DSC supports renaming solely within the same schema. Renaming within the same schema omits the schema clause from the conversion result, while attempts to rename across schemas trigger an error report.

Input

1
2
3
4
ALTER TABLE `shce1`.`t1` rename to `t2`;
ALTER TABLE `shce1`.`t1` rename to t2;
ALTER TABLE `charge_data`.`group_shengfen2022` RENAME `charge_data`.`group_shengfen2022_jiu`;
ALTER TABLE `charge_data`.`group_shengfen2022` RENAME `charge_data`.`group_shengfen2022_jiu`, RENAME `charge_data`.`group_shengfen2023_jiu`, RENAME `charge_data`.`group_shengfen2024_jiu`;

Output

1
2
3
4
ALTER TABLE "shce1"."t1" RENAME TO "t2";
ALTER TABLE "shce1"."t1" RENAME TO "t2";
ALTER TABLE "charge_data"."group_shengfen2022" RENAME TO "group_shengfen2022_jiu";
ALTER TABLE "charge_data"."group_shengfen2022" RENAME TO "group_shengfen2022_jiu", RENAME TO "group_shengfen2023_jiu", RENAME TO "group_shengfen2024_jiu";