Re: limit tables size - Mailing list pgsql-novice

From alex
Subject Re: limit tables size
Date
Msg-id 42BE9491.3070704@arkantechnologies.com
Whole thread Raw
In response to Re: unpacking composite values  (Keith Worthington <KeithW@NarrowPathInc.com>)
List pgsql-novice
Keith Worthington wrote:

> alex wrote:
>
>> Hi,
>>
>> Is it possible to limit the size or the number of rows of table, in a
>> FIFO mode for example ??
>>
>> Regards
>>
>> Al
>
>
> Hmmm, do you mean that every time a row is INSERTed that you want to
> delete the oldest row?
>
> How about a serial column and an AFTER INSERT trigger?  The trigger
> could search for and delete the row with the smallest serial value.
> This could get real slow if your table is huge.  If the volume is high
> enough then you will have to handle wrap around.  You could simply
> write a script that would subtract the minimum value from all the rows
> when the serial reached the maximum.
>
Yes It may be the solution, look at the index some times and delete the
old ones ...

kind regards

Al

pgsql-novice by date:

Previous
From: Keith Worthington
Date:
Subject: Re: unpacking composite values
Next
From: Minal
Date:
Subject: Problem with startup