Re: [GENERAL] - Regarding Schema ROLLBACK

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: VENKTESH GUTTEDAR <venkteshguttedar(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] - Regarding Schema ROLLBACK
Date: 2017-11-28 15:38:33
Message-ID: CANu8FiwSstAX3_DvVOkLTs1wzQ+4zH12Ud2j_OzXu6iKPHtgDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 28, 2017 at 7:23 AM, VENKTESH GUTTEDAR <
venkteshguttedar(at)gmail(dot)com> wrote:

> Hello All,
>
>
> I have run CREATE SCHEMA xyz accidentally, and it replaced my existing
> schema (xyz) with tables, and i have lost all my data.
>
> Is there any way to rollback or get the schema back with old tables
> and data.
>
> Any help would be appreciated.
>
> --
> Regards :
> Venktesh Guttedar.
>
>
*>Is there any way to rollback or get the schema back with old tables and
data.*

*Hopefully you have a pg_dump of the database or schema.*
*If it in in plain format, you can edit the dump and recover the tables
that way.*

*If it is in custom format, you can use the -l option to list and edit,
then restore with -L option.*

*https://www.postgresql.org/docs/9.6/static/app-pgrestore.html
<https://www.postgresql.org/docs/9.6/static/app-pgrestore.html>*

*Otherwise, your next option would be trying to use PITR recovery,
providing you have available WAL files.*

*https://www.postgresql.org/docs/9.6/static/continuous-archiving.html
<https://www.postgresql.org/docs/9.6/static/continuous-archiving.html>*

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-11-28 15:43:37 Re: [GENERAL] - Regarding Schema ROLLBACK
Previous Message Tom Lane 2017-11-28 15:18:35 Re: SV: Refreshing materialized views