Re: limit table to one row

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Brandon Metcalf <brandon(at)geronimoalloys(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: limit table to one row
Date: 2009-06-08 13:19:23
Message-ID: b42b73150906080619s5eb4650cud0e0daf75e601fee@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jun 7, 2009 at 1:38 AM, Craig Ringer<craig(at)postnewspapers(dot)com(dot)au> wrote:
> Brandon Metcalf wrote:
>> Is there a way when creating a table to limit it to one row?  That is,
>> without using a stored procedure?
>>
>> I searched the documentation, but didn't find anything.
>>
>
>
> CREATE TABLE x (...);
>
> CREATE UNIQUE INDEX x_only_one_row ON ((1));

very clever :D

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Preeti Khurana 2009-06-08 13:38:16 Postgres's Performance degrades after heavy db operation
Previous Message Merlin Moncure 2009-06-08 13:18:19 Re: Using results from DELETE ... RETURNING