Re: limit table to one row

Поиск
Список
Период
Сортировка
От Brandon Metcalf
Тема Re: limit table to one row
Дата
Msg-id Pine.LNX.4.58L.0906041521360.17533@cedar.geronimoalloys.com
обсуждение исходный текст
Ответ на Re: limit table to one row  (Richard Broersma <richard.broersma@gmail.com>)
Ответы Re: limit table to one row  (Richard Broersma <richard.broersma@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Richard Broersma
Дата:
Сообщение: Re: limit table to one row
Следующее
От: Richard Broersma
Дата:
Сообщение: Re: limit table to one row