Simon Riggs <[EMAIL PROTECTED]> writes: > What I'd like to do is add an ERRORTABLE clause to COPY. The main > problem is how we detect a duplicate row violation, yet prevent it from > aborting the transaction.
If this only solves the problem of duplicate keys, and not any other kind of COPY error, it's not going to be much of an advance. > Flow of control would be to: > locate page of index where value should go > lock index block > _bt_check_unique, but don't error > if violation then insert row into ERRORTABLE > else > insert row into data block > insert row into unique index > unlock index block > do other indexes Ugh. Do you realize how many levels of modularity violation are implied by that sketch? Have you even thought about the fact that we have more than one kind of index? regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match