Saturday, May 6, 2017

PostgreSQL: move from child table to parent table

Source: Postgres table inheritance: move from parent to child and vice versa
1
with deleted as (delete from <child> returning *) insert into <parent> select * from deleted</parent></child>