Subject Re: [firebird-support] DUP key on restore
Author Tomasz Tyrakowski
My point exactly. That's why I adviced checking for duplicates _after_
removing indices and primary keys on problematic tables. I've never
tried the method proposed by Svein, but if it really omits indices, it's
better than mine (more subtle and doesn't mess with metadata).

regards
Tomasz

On 2011-11-17 08:10, Svein Erling Tysvær wrote:
>> Hi Tomasz. I already checked the source database for duplicated entries,
>> and found none, but i did not tried to verify the database with gfix.
>
> Exactly how did you check it for duplicate entries? The point is that if there's a problem with an index or key, then doing
>
> SELECT MyIndexedField, count(*)
> FROM MyTable
> GROUP BY 1
> HAVING count(*)> 1
>
> will use the index/key and not discover the duplicate entry, whereas
>
> SELECT MyIndexedField+0, count(*)
> FROM MyTable
> GROUP BY 1
> HAVING count(*)> 1
>
> cannot use the index and will find such duplicates.
>
> HTH,
> Set
>


--
__--==============================--__
__--== Tomasz Tyrakowski ==--__
__--== SOL-SYSTEM ==--__
__--== http://www.sol-system.pl ==--__
__--==============================--__