PGSQL

复制表

into方式,新表不存在  ; 可添加过滤条件,可选字段;索引、注释不会复制;数据也会复制过去

select
nameid
,traffic
,update_time
into test0002 from test0001 where  nameid = 111

as ,   可添加过滤条件,可选字段;索引、注释不会复制;数据也会复制过去

create table if not exists dbscheme.test0003  as select * from  dbscheme.test0001;

 

like     主键约束、索引、注释可以复制;数据不会复制过去

create table if not exists dbscheme.test0004 (like dbscheme.test0001 INCLUDING INDEXES INCLUDING COMMENTS);

like 不加条件,只复制表 没有复制主键、索引、注释

create table if not exists dbscheme.test0005 (like dbscheme.test0001 );

 

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2022-03-04
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案