Re: limit table to one row

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: limit table to one row
Дата
Msg-id 396486430906041317l1ac3092ep70d4960df8e0032d@mail.gmail.com
обсуждение исходный текст
Ответ на limit table to one row  (Brandon Metcalf <brandon@geronimoalloys.com>)
Ответы Re: limit table to one row  (Brandon Metcalf <brandon@geronimoalloys.com>)
Re: limit table to one row  (Niklas Johansson <pgmailings@codecraft.se>)
Список pgsql-general
On Thu, Jun 4, 2009 at 1:13 PM, Brandon Metcalf
<brandon@geronimoalloys.com> wrote:
> Is there a way when creating a table to limit it to one row?  That is,
> without using a stored procedure?


Sure just add a check constraint along the lines of:

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

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

В списке pgsql-general по дате отправления:

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