Re: [GENERAL] Move rows from one database to other - Mailing list pgsql-general

From Thomas Güttler
Subject Re: [GENERAL] Move rows from one database to other
Date
Msg-id 95241ec8-4900-7eef-7dbe-c868c5ce20d5@thomas-guettler.de
Whole thread Raw
In response to Re: [GENERAL] Move rows from one database to other  (Leknín Řepánek <godzilalalala@gmail.com>)
Responses Re: [GENERAL] Move rows from one database to other  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-general

Am 23.02.2017 um 13:44 schrieb Leknín Řepánek:
> Maybe you can do something like
>
> WITH cte AS (
> DELETE FROM t1 WHERE cond
> RETURNINIG *
> )
> INSERT into t2
> SELECT * FROM cte;
>
> To move rows between tables with combination with fdw_postgres and
> foreign table.


... this way you don't need the second table ... nice.


--
Thomas Guettler http://www.thomas-guettler.de/


pgsql-general by date:

Previous
From: Thomas Güttler
Date:
Subject: Re: [GENERAL] Move rows from one database to other
Next
From: Ertan Küçükoğlu
Date:
Subject: Re: [GENERAL] Latest PostgreSQL on Raspbian Jessie - solved