Search Postgresql Archives

Re: limit table to one row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



r == richard.broersma@xxxxxxxxx writes:

 r> On Thu, Jun 4, 2009 at 1:13 PM, Brandon Metcalf
 r> <brandon@xxxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux