pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed[GENERAL] - Regarding Schema ROLLBACK
5+ messages / 5 participants
[nested] [flat]
* [GENERAL] - Regarding Schema ROLLBACK
@ 2017-11-28 12:23 VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: VENKTESH GUTTEDAR @ 2017-11-28 12:23 UTC (permalink / raw)
To: pgsql-general
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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [GENERAL] - Regarding Schema ROLLBACK
@ 2017-11-28 15:38 Melvin Davidson <melvin6925@gmail.com>
parent: VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Melvin Davidson @ 2017-11-28 15:38 UTC (permalink / raw)
To: VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>; +Cc: pgsql-general
On Tue, Nov 28, 2017 at 7:23 AM, VENKTESH GUTTEDAR <
venkteshguttedar@gmail.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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [GENERAL] - Regarding Schema ROLLBACK
@ 2017-11-28 15:43 David G. Johnston <david.g.johnston@gmail.com>
parent: VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: David G. Johnston @ 2017-11-28 15:43 UTC (permalink / raw)
To: VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>; +Cc: pgsql-general
On Tue, Nov 28, 2017 at 5:23 AM, VENKTESH GUTTEDAR <
venkteshguttedar@gmail.com> wrote:
> I have run CREATE SCHEMA xyz accidentally, and it replaced my existing
> schema (xyz) with tables, and i have lost all my data.
>
As far as I know "CREATE SCHEMA" by itself cannot "drop" data nor would it
successfully execute if a schema of the same name already exist...
As Melvin says if you've truly dropped the data you will need to resort to
backups of some form.
David J.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [GENERAL] - Regarding Schema ROLLBACK
@ 2017-11-28 18:50 Alban Hertroys <haramrae@gmail.com>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Alban Hertroys @ 2017-11-28 18:50 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>; pgsql-general
> On 28 Nov 2017, at 16:43, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
> On Tue, Nov 28, 2017 at 5:23 AM, VENKTESH GUTTEDAR <venkteshguttedar@gmail.com> wrote:
> I have run CREATE SCHEMA xyz accidentally, and it replaced my existing schema (xyz) with tables, and i have lost all my data.
>
> As far as I know "CREATE SCHEMA" by itself cannot "drop" data nor would it successfully execute if a schema of the same name already exist...
>
> As Melvin says if you've truly dropped the data you will need to resort to backups of some form.
>
> David J.
Just what I was thinking. Are you looking in the correct database?
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [GENERAL] - Regarding Schema ROLLBACK
@ 2017-11-28 18:58 Rakesh Kumar <rakeshkumar464@mail.com>
parent: Alban Hertroys <haramrae@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Rakesh Kumar @ 2017-11-28 18:58 UTC (permalink / raw)
To: Alban Hertroys <haramrae@gmail.com>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>; pgsql-general
> Just what I was thinking. Are you looking in the correct database?
All: He has already replied to me earlier that he had indeed dropped the schema before creating it.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2017-11-28 18:58 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 12:23 [GENERAL] - Regarding Schema ROLLBACK VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>
2017-11-28 15:38 ` Melvin Davidson <melvin6925@gmail.com>
2017-11-28 15:43 ` David G. Johnston <david.g.johnston@gmail.com>
2017-11-28 18:50 ` Alban Hertroys <haramrae@gmail.com>
2017-11-28 18:58 ` Rakesh Kumar <rakeshkumar464@mail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox