Re: limit table to one row

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: limit table to one row
Дата
Msg-id 4A2B5272.3000506@postnewspapers.com.au
обсуждение исходный текст
Ответ на limit table to one row  (Brandon Metcalf <brandon@geronimoalloys.com>)
Ответы Re: limit table to one row  (Merlin Moncure <mmoncure@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Using results from DELETE ... RETURNING
Следующее
От: Florian Weimer
Дата:
Сообщение: Re: How to store text files in the postgresql?