Re: [PATCHES] Inherited Constraints

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: [PATCHES] Inherited Constraints
Дата
Msg-id 1134064188.63851.123.camel@home
обсуждение исходный текст
Ответ на Re: [PATCHES] Inherited Constraints  (Hannu Krosing <hannu@skype.net>)
Список pgsql-hackers
> Another nice (but no doubt more complex) thing would be ability to add
> multiple constraints at once, needing only one seqscan to check for
> compliance with added constraints and/or making constraint checks
> smarter, so that for.ex. "ADD CONSTRAINT CHECK i > 0" could make use of
> index on i instead of doing a seqscan. Or if there is a constraint
> "CHECK i > 0" then adding another like "CHECK i > -1" would not need to
> check actual data either.

Check out the comma in alter table.

ALTER TABLE tab ADD COLUMN serial NOT NULL UNIQUE,ADD CHECK (foo > 24),ADD CHECK (baz < 18),ADD COLUMN integer NOT NULL
DEFAULT32;
 

Table tab (and each of the tables that inherits from it) is scanned and
rewritten once.

I believe this was added for 8.0.

-- 



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Reducing contention for the LockMgrLock
Следующее
От: Tom Lane
Дата:
Сообщение: bgwriter leaks resources after errors