Re: rollback

Поиск
Список
Период
Сортировка
От Klint Gore
Тема Re: rollback
Дата
Msg-id 48756321.3090505@une.edu.au
обсуждение исходный текст
Ответ на Re: rollback  (Adrian Moisey <adrian@careerjunction.co.za>)
Список pgsql-general
Adrian Moisey wrote:
> Hi
>
> >>>> I would like to be able to "mark" a point in my postgres database.
> >>>> After that I want to change a few things and "rollback" to that point.
> >>>> Does postgres support such a thing?  Is it possible for me to do this?
> >>> Well, transactions do that. If you want to do this inside a
> >>> transaction, the term you're looking for is "savepoints".
> >> I would like to do this globally over the entire DB, is that possible?
> >
> > Sure. You can start a transaction, create tables, drop tables, do
> > inserts and deletes, update some tables, create and delete functions,
> > triggers, views and schemas. After that, rollback. No problem.
>
> Can I do this outside of a transaction?
>
>
How about
   create database a_copy template = original_database

To recover at later date
  drop database original_database;
  alter database a_copy rename to original_database;

There will be all sorts of issues so it might be impractical depending
on your situation.
- permission (have to be able to create/drop/rename databases)
- concurrency (noone connected for the drop, everything done by anyone
else will be forgotten as well)
- time / capacity (creating a copy of a large database might take a
while and need extra storage)

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4@une.edu.au


В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Making a RPM installer
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Making a RPM installer