![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
When importing a bunch of data (> 85000 rows) I get an error I can't explain. The table into which I'm importing has a unique clause on (code, bedrijf). The rows in the source-table are unique in this aspect, yet when I do the import I get this "ERROR: duplicate key violates unique constraint "werknemer_bedrijf_key". |
|
I checked the sourcetable a number of times, even COPYd the relevant columns to a textfile and did `uniq -d` and `uniq -D` (nothing non-unique found), tried to delete out non-unique rows (again nothing found). |
#3
| |||
| |||
|
|
Is there a bug in the UNIQUE behaviour? |
|
Is there any way I can DEFER the unique clause, or remove it and put it back later? |
#4
| |||
| |||
|
|
"Joolz" <joolz (AT) arbodienst-limburg (DOT) nl> writes: Is there a bug in the UNIQUE behaviour? No known bugs, anyway. I'm inclined to guess that your target table has slightly different datatypes than the source, and that results in equal values for some reason (such as fractional values being rounded to integer, or char vs varchar having different ideas about significance of trailing blanks). Is there any way I can DEFER the unique clause, or remove it and put it back later? You can always drop and re-add the constraint ... but I'll be pretty surprised if that gets around the problem (ie, I bet re-adding the constraint will fail). |
![]() |
| Thread Tools | |
| Display Modes | |
| |