From: Paul Lambert <paul.lambert@autoledgers.com.au>
To: Chris Hoover <revoohc@gmail.com>
Cc: Jim Nasby <decibel@decibel.org>
Cc: pgsql-admin@postgresql.org Admin <pgsql-admin@postgresql.org>
Subject: Re: Deletes hurt
Date: Fri, 01 Jun 2007 06:42:04 +0800
Message-ID: <465F4F3C.6060709@autoledgers.com.au> (raw)
In-Reply-To: <1d219a6f0705311210r26e696afi24356ee428b73a33@mail.gmail.com>
References: <734907A8-F30D-4924-8C97-30D2898CA43C@decibel.org>
<1d219a6f0705311210r26e696afi24356ee428b73a33@mail.gmail.com>
Chris Hoover wrote:
> Just curious, what sort of field do they use to mark the rows? I'm
> assuming a timestamp since it would half to be part of the primary key,
> or am I way off? This has really gotten me thinking about how I might
> implement this in my database.
>
> Thanks,
>
> Chris
>
I do this on a number of tables in my database, I use a byte to store a
status, with each 'bit' meaning something, usually the 128 bit indicates
deleted, so any value over 128 means the record is not current and that
is tested for in any standard queries.
This doesn't get around allowing multiple rows with the same data, with
one being current and the rest deleted - but that's not an issue in my
system. If it's deleted it's deleted, it doesn't get recreated, but can
be restored, thus not using an actual delete fits my scenario quite well.
--
Paul Lambert
Database Administrator
AutoLedgers
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-admin@postgresql.org
Cc: paul.lambert@autoledgers.com.au, revoohc@gmail.com, decibel@decibel.org
Subject: Re: Deletes hurt
In-Reply-To: <465F4F3C.6060709@autoledgers.com.au>
* 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