Re: [PATCHES] Inherited Constraints - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: [PATCHES] Inherited Constraints
Date
Msg-id 1134064188.63851.123.camel@home
Whole thread Raw
In response to Re: [PATCHES] Inherited Constraints  (Hannu Krosing <hannu@skype.net>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing contention for the LockMgrLock
Next
From: Tom Lane
Date:
Subject: bgwriter leaks resources after errors