Mario Splivalo wrote:
Declaring constraints as deferrable doesn't do anything as such, you have to actually set the constraints deferred to have an effect. You have to do it within a transaction block. If done outside of the transaction block, there is no effect: This is what happens when "set constraints" is issued outside the transaction block: < constraint test1_pk primary key(col1) deferrable);ÂÂÂÂÂÂÂÂÂÂÂIt works like a charm when issued within the transaction block: scott=# begin;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂI was able to insert the same value twice, it only failed at the end of the transaction. You cannot tell which part takes a long time, select or insert, without profiling. I certainly cannot do it over the internet.But, just for the sake of clarification - I tought that DEFERRABLE would matter if I do a lot of INSERTs, inside a FOR loop or something like that. Since I'm doing INSERT INTO ... SELECT, does it makes any difference? -- Mladen Gogala Sr. Oracle DBA 1500 Broadway New York, NY 10036 (212) 329-5251 http://www.vmsinfo.com The Leader in Integrated Media Intelligence Solutions |