Re: limit table to one row

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brandon Metcalf <brandon(at)geronimoalloys(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: limit table to one row
Date: 2009-06-06 18:12:04
Message-ID: b42b73150906061112j3a74caa6od9a71ac7ebe925fb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jun 6, 2009 at 2:07 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
>> On Thu, Jun 4, 2009 at 4:13 PM, Brandon
>> Metcalf<brandon(at)geronimoalloys(dot)com> wrote:
>>> Is there a way when creating a table to limit it to one row?  That is,
>>> without using a stored procedure?
>
>> you can also do it with a trigger.
>
> If you're willing to use a trigger, just insert the one allowed row
> and then install a trigger that throws error for any insert or delete
> attempt ...

what if you need to delete then insert? :-)

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-06 18:29:36 Re: limit table to one row
Previous Message Tom Lane 2009-06-06 18:07:42 Re: limit table to one row