Re: limit table to one row - Mailing list pgsql-general

From Craig Ringer
Subject Re: limit table to one row
Date
Msg-id 4A2B5272.3000506@postnewspapers.com.au
Whole thread Raw
In response to limit table to one row  (Brandon Metcalf <brandon@geronimoalloys.com>)
Responses Re: limit table to one row
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using results from DELETE ... RETURNING
Next
From: Florian Weimer
Date:
Subject: Re: How to store text files in the postgresql?