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

From Brandon Metcalf
Subject Re: limit table to one row
Date
Msg-id Pine.LNX.4.58L.0906041521360.17533@cedar.geronimoalloys.com
Whole thread Raw
In response to Re: limit table to one row  (Richard Broersma <richard.broersma@gmail.com>)
Responses Re: limit table to one row
List pgsql-general
r == richard.broersma@gmail.com writes:

 r> On Thu, Jun 4, 2009 at 1:13 PM, Brandon Metcalf
 r> <brandon@geronimoalloys.com> wrote:
 r> > Is there a way when creating a table to limit it to one row? �That is,
 r> > without using a stored procedure?


 r> Sure just add a check constraint along the lines of:

 r> CONSTRAINT Only_one_row
 r>     CHECK( tableuniqueid = 1 ); --assuming you row has a unique id of 1


Got it.  Currently, it doesn't have a column for an ID, but I can add
one if this is the only way.

--
Brandon

pgsql-general by date:

Previous
From: Richard Broersma
Date:
Subject: Re: limit table to one row
Next
From: Richard Broersma
Date:
Subject: Re: limit table to one row