Re: unpacking composite values

Поиск
Список
Период
Сортировка
От Keith Worthington
Тема Re: unpacking composite values
Дата
Msg-id 42BE90F4.3000102@NarrowPathInc.com
обсуждение исходный текст
Ответ на Re: unpacking composite values  (alex <alex.ricci@arkantechnologies.com>)
Ответы Re: limit tables size  (alex <alex.ricci@arkantechnologies.com>)
Список pgsql-novice
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.

--
Kind Regards,
Keith

В списке pgsql-novice по дате отправления:

Предыдущее
От: alex
Дата:
Сообщение: Re: unpacking composite values
Следующее
От: alex
Дата:
Сообщение: Re: limit tables size