Re: rollback - Mailing list pgsql-sql

From Haller Christoph
Subject Re: rollback
Date
Msg-id 200110261226.OAA02963@rodos
Whole thread Raw
In response to rollback  (Oleg Lebedev <olebedev@waterford.org>)
List 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 


pgsql-sql by date:

Previous
From: "Dmitry G. Mastrukov" Дмитрий Геннадьевич Мастрюков
Date:
Subject: Re: GUID in postgres
Next
From: Horst Herb
Date:
Subject: Re: Diferent databases on same query...