Skip site navigation (1) Skip section navigation (2)

Re: limiting number of allowed rows in a table

From: Vanja <milosevski(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: limiting number of allowed rows in a table
Date: 2005-12-28 16:35:07
Message-ID: ed6f95fd0512280835v300966feqc25b77eb76b73deb@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Yes, I kinda had the same thing in mind about somehow using COUNT(*)
but without any success so far. Can you please give me a code fragment
on how would you implement this? Thanks.


On 12/28/05, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
>
> I don't think there is such a constraint (but would love to hear otherwise).
> However, you could place a trigger on a table that does a count(*) on the
> table (which might be time-consuming on a large table, but....) and then
> does whatever you want (ignore the insert, put it in another table, or
> delete an old row before inserting the new one).  Why do you want to limit
> the number of rows?
>
> Sean
>
>
>

In response to

pgsql-novice by date

Next:From: Christopher BrowneDate: 2005-12-28 17:11:30
Subject: Re: limiting number of allowed rows in a table
Previous:From: Sean DavisDate: 2005-12-28 15:00:00
Subject: Re: limiting number of allowed rows in a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group