| От | Thomas Kellerer |
|---|---|
| Тема | Re: Single Row Table? |
| Дата | |
| Msg-id | ch2ijf$iem$1@sea.gmane.org обсуждение |
| Ответ на | Re: Single Row Table? (Tim Penhey <tim@penhey.net>) |
| Ответы |
Re: Single Row Table?
|
| Список | pgsql-general |
Tim Penhey wrote on 30.08.2004 23:12: >> I have got a table which is supposed to contain only one row. It does >> not have any primary keys defined. >> >> So, essentially, when a new insert happens in that table, I would like >> it (the insert) to fail if there is already a row existing in that table. >> >> > You could try: > > id INT PRIMARY KEY NOT NULL DEFAULT(1) CHECK (id = 1), > I like that approach :) But should you also prevent DELETE's from that table? Otherwise you could wind up with no rows at all. I guess that would have to be done using a rule... Thomas
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера