Subject | Re: restore - attempt to store duplicate value |
---|---|
Author | Adam |
Post date | 2005-12-16T23:21:58Z |
--- In firebird-support@yahoogroups.com, "mat" <mpaczek@k...> wrote:
transactions) in unique index rdb$index_2". Restore with deactivated
indexes doesn't work also. So is my database corrupted seriously? And
how can I fix it? How can I find out which values are duplicated?
If you still have the original Look for rdb$index_2 to find out what
it is, then drop index. Write a query like this
select id, count(*)
from mytable
group by id
having count(*) > 1
(where id is your supposedly unique field)
If the index is too complex to drop, then you can probably trick the
optimiser to not use it.
select id+0, count(*)
from mytable
group by 1
having count(*) > 1
(hopefully it is a reasonably small table)
Adam
>following error "Attempt to store duplicated value (visible to active
> Hi All.
>
> During restore of my database using FB 1.5.2.4731i've got the
transactions) in unique index rdb$index_2". Restore with deactivated
indexes doesn't work also. So is my database corrupted seriously? And
how can I fix it? How can I find out which values are duplicated?
>Mat,
> Thanks for any help.
>
> greetings,
> mat
If you still have the original Look for rdb$index_2 to find out what
it is, then drop index. Write a query like this
select id, count(*)
from mytable
group by id
having count(*) > 1
(where id is your supposedly unique field)
If the index is too complex to drop, then you can probably trick the
optimiser to not use it.
select id+0, count(*)
from mytable
group by 1
having count(*) > 1
(hopefully it is a reasonably small table)
Adam