Re: rollback

From: Haller Christoph <ch(at)rodos(dot)fzk(dot)de>
To: olebedev(at)waterford(dot)org (Oleg Lebedev)
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: rollback
Date: 2001-10-26 14:26:43
Message-ID: 200110261226.OAA02963@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Hi everybody,
> I was playing with psql and accidently deleted a couple of records from
> my database. I am wondering if there is any way to restore them. I know
> that in Oracle you can do 'rollback work' from SQLPlus interface and it
> would rollback all the updates done to the database.
That's available in PostgreSQL too.
But, by entering psql autocommit is on by default, meaning every sql
command is committed at once.
To enable a rollback in psql you have to enter a transaction explicitly
by using BEGIN;
Everything done below BEGIN can be rolled back.
Try.

> I am pretty sure that from now on I would try to revoke permissions to
> delete anything from the database from users like myself. What is the
> best way to do this?
Refer to the sql commands GRANT and REVOKE within the documentation.
Additionally, you should check the CREATE GROUP command.
Creating groups of users is a very elegant way to grant/revoke
permissions on objects.
As far as I know there is no way to revoke delete permissions
on the database as whole, you have to list all tables you want to
have delete permissions dropped.
Regards, Christoph

In response to

  • rollback at 2001-10-26 00:45:35 from Oleg Lebedev

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-10-26 16:34:08 Re: Connecting to different DataBase In PlPgsql Function
Previous Message Horst Herb 2001-10-26 14:24:53 Re: Diferent databases on same query...