[GENERAL] - Regarding Schema ROLLBACK

Started by VENKTESH GUTTEDARover 8 years ago5 messagesgeneral
Jump to latest
#1VENKTESH GUTTEDAR
venkteshguttedar@gmail.com

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.

#2Melvin Davidson
melvin6925@gmail.com
In reply to: VENKTESH GUTTEDAR (#1)
Re: [GENERAL] - Regarding Schema ROLLBACK

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&gt;*

*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&gt;*

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

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: VENKTESH GUTTEDAR (#1)
Re: [GENERAL] - Regarding Schema ROLLBACK

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.

#4Alban Hertroys
haramrae@gmail.com
In reply to: David G. Johnston (#3)
Re: [GENERAL] - Regarding Schema ROLLBACK

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.

#5Rakesh Kumar
rakeshkumar464@mail.com
In reply to: Alban Hertroys (#4)
Re: [GENERAL] - Regarding Schema ROLLBACK

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.