Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()

Поиск
Список
Период
Сортировка
От amul sul
Тема Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()
Дата
Msg-id 862791678.12260510.1449132763399.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответы Re: Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Re: Passing initially_valid values instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints()  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi ALL,

Need your suggestions.
initially_valid flag is added to make column constraint valid. (commit :
http://www.postgresql.org/message-id/E1Q2Ak9-0006hK-M4@gemulon.postgresql.org)


IFAICU, initially_valid and skip_validation values are mutually exclusive at constraint creation(ref: gram.y), unless
itset explicitly.
 

Can we pass initially_valid instead of !skip_validation to StoreRelCheck() in AddRelationNewConstraints(), as shown
below?

==========================================================================================
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 7d7d062..04c4f8f 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -2349,7 +2349,7 @@ AddRelationNewConstraints(Relation rel,
* OK, store it.
*/
constrOid =
-        StoreRelCheck(rel, ccname, expr, !cdef->skip_validation, is_local,
+        StoreRelCheck(rel, ccname, expr, cdef->initially_valid, is_local,
is_local ? 0 : 1, cdef->is_no_inherit, is_internal);

numchecks++;

==========================================================================================


This will make code more readable & in my case this could enable to skip validation of existing data as well as mark
checkconstraint valid, when we have assurance that modified/added constraint are valid.
 

Comments? Thoughts? 

Regards,
Amul Sul



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

Предыдущее
От: "Shulgin, Oleksandr"
Дата:
Сообщение: Re: Logical replication and multimaster
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Rework the way multixact truncations work