Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1USnWs-0003FK-6b for pgsql-sql@arkaria.postgresql.org; Thu, 18 Apr 2013 12:01:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1USnWr-0004vu-NN for pgsql-sql@arkaria.postgresql.org; Thu, 18 Apr 2013 12:01:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1USnWr-0004vd-33 for pgsql-sql@postgresql.org; Thu, 18 Apr 2013 12:01:29 +0000 Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1USnWk-0000FD-OE for pgsql-sql@postgresql.org; Thu, 18 Apr 2013 12:01:28 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1USnWe-0005Fg-F3 for pgsql-sql@postgresql.org; Thu, 18 Apr 2013 14:01:16 +0200 Received: from ip-118-90-114-123.xdsl.xnet.co.nz ([118.90.114.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Apr 2013 14:01:16 +0200 Received: from jasen by ip-118-90-114-123.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Apr 2013 14:01:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Jasen Betts Subject: Re: Peer-review requested of soft-delete scheme Date: 18 Apr 2013 11:44:41 GMT Organization: Dis (not Dat) Organisation Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-118-90-114-123.xdsl.xnet.co.nz X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-18 (Linux) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 2013-04-16, Mark Stosberg 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