Re: ENABLE/DISABLE CONSTRAINT NAME

Поиск
Список
Период
Сортировка
От wangshuo@highgo.com.cn
Тема Re: ENABLE/DISABLE CONSTRAINT NAME
Дата
Msg-id 8b427d729107f474038a6f6908aef82a@highgo.com.cn
обсуждение исходный текст
Ответ на Re: ENABLE/DISABLE CONSTRAINT NAME  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
于 2013-08-30 21:27, Tom Lane 回复:
> wangshuo@highgo.com.cn writes:
>>        In order to achieve enable/disable constraint name,I made ​​a 
>> few
>> modifications to the code.
>>        First, someone used to build the constraints while building
>> table. Then inserting data must follow a certain order.
>>        And people usually like to insert the data but not affected 
>> by
>> foreign keys or check.
>>        Second, the check or the foreign key constraint will waste 
>> much
>> time while inserting the data into the table.
>>        Due to the above reasons,I realized this command.

Tom Lane <tgl@sss.pgh.pa.us> writes:
> Uh ... why not just drop the constraint, and re-add it later if you 
> want
> it again?

Thanks for your reply.

If you drop the constraint,you must record the sql of the constraint.
ENABLE/DISABLE just turn off or trun on that.The sql2008 support this.

And, Oracle,DB2,SQL Server,MySQL all support this feature, new users 
ever used Oracle are accustomed to
use, besides, this feature benefits data migration, so we have enough 
reasons to
add this feature.

> This seems like adding a lot of mechanism (and possible bugs)
> for a rather marginal use-case.
>
>             regards, tom lane


I changed the pg_constraint system table , the  ConstrCheck struct, the
CreateTrigger function, the  CreateConstraintEntry function and some 
grammars.
I have passed the pgtest,and this may has some bugs.

I refer to the validation feature to do this feature.
The validation feature only works while adding constraint,
my work is a supplement to the validation feature.
If possible, I would like to merge the two features together.

For all above, I wrote this letter to community, to let more people to 
talk about
this and correct possible bugs.


     Wang Shuo     HighGo Software Co.,Ltd.     September 1, 2013




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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [v9.4] row level security
Следующее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: CREATE FUNCTION .. SET vs. pg_dump