postgreSQL |表继承

 建立父表sql

create table public.tb_parent(
id serial not null,
name text not null,
primary key(id)
);

 建立子表code

create table tb_child_0(
)
inherits (tb_parent);

一、父表数据同步

二、子表数据it

三、往子表插入数据table

四、结果:父表中会出现子表的记录,若是修改子表记录,则会同步到父表class

相关文章
相关标签/搜索