Re: Limiting Row Count In a Table??

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ça??l ?eker <cagils(at)biznet(dot)com(dot)tr>
Cc: "PostgreSQL-General-List (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Limiting Row Count In a Table??
Date: 2002-12-02 15:34:02
Message-ID: 20021202153402.GA20537@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 02, 2002 at 17:04:06 +0200,
Ça??l ?eker <cagils(at)biznet(dot)com(dot)tr> wrote:
> Hello,
>
> Is there a way in PG that allows limiting number of rows for a table.
>
> If not maybe there is another way to achieve this:
> I want my table to have only one row, if any other row is inserted or this one row is deleted it should give an error and won't let it go.
>
> How can this be done the right way?

A good start would be to only give out select and update access (and not
delete or insert access).

If that isn't good enough, then you will need to write triggers or rules
to do it.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2002-12-02 15:37:08 PostgreSQL Version 7.3 Released! (repost)
Previous Message Tom Lane 2002-12-02 15:28:35 Re: Limiting Row Count In a Table??