"=?utf-8?B?Q2F0YWxpbih1eCkgTS4gQm9pZQ==?=" <catab@xxxxxxxxxxxxx> writes: > I hope I make myself clear now: I want a possibility to add a CHECK that will be used for partitioning without having to read all data for validation. Basically, this is unlikely to be accepted, because it does not conform with the project's worldview. If you are intent on being smarter than the database is, you could probably create a NOT VALID constraint and then manually poke the system catalogs to mark it as valid. Then, when (not if) you make a mistake, you will have only yourself to blame. A patch that would stand some chance of getting accepted would be one that would act like CREATE INDEX CONCURRENTLY: create the constraint as NOT VALID (so it's getting enforced against new rows), then in background scan all the existing rows to make sure they meet the constraint too, then finally mark the constraint VALID. But we don't consider that second step to be optional. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general