From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: Peer-review requested of soft-delete scheme
Date: 18 Apr 2013 11:44:41 GMT
Message-ID: <kkomb9$skn$2@gonzo.reversiblemaps.ath.cx> (raw)
References: <kkjtv3$a75$1@ger.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
On 2013-04-16, Mark Stosberg <mark@summersault.com> wrote:
> My challenge is that I want to make very hard or impossible to access
> the soft-deleted rows through SELECT statements. There are lots of
> selects statements in the system.
>
> My current idea is to rename the "foo" table to something that would
> stand-out like "foo_with_deleted_rows". Then we would create a view
> named "foo" that would select all the rows except the soft-deleted views.
[...]
> Is this sensible? Is there another approach to soft-deletes I should be
> considering?
yes, rename the table and replace it with a view that excludes the soft
deleted records. Make "do instead" rules to handle inserts, updates
and deletes on the view by rediecting them to the base table.
--
⚂⚃ 100% natural
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
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: jasen@xnet.co.nz
Subject: Re: Peer-review requested of soft-delete scheme
In-Reply-To: <kkomb9$skn$2@gonzo.reversiblemaps.ath.cx>
* 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