From: Haller Christoph <ch@rodos.fzk.de>
To: olebedev@waterford.org
Cc: pgsql-sql@postgresql.org
Subject: Re: rollback
Date: Fri, 26 Oct 2001 14:26:43 METDST
Message-ID: <200110261226.OAA02963@rodos> (raw)
In-Reply-To: <3BD8B22F.AA385530@waterford.org>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ch@rodos.fzk.de, olebedev@waterford.org
Subject: Re: rollback
In-Reply-To: <200110261226.OAA02963@rodos>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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