Re: limit table to one row

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Brandon Metcalf <brandon(at)geronimoalloys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: limit table to one row
Date: 2009-06-07 05:38:58
Message-ID: 4A2B5272.3000506@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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));

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian Weimer 2009-06-07 09:10:57 Re: How to store text files in the postgresql?
Previous Message Tom Lane 2009-06-07 04:29:56 Re: Using results from DELETE ... RETURNING