[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Upgrade Error



Hello all,

I am trying to apply the "Pg-upgrade-2.6.18-2.6.19.sql" file to my database since the command "select version from defaults" returned "2.6.18", but I am receiving the following error:

NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "tax_pkey" for table "tax"
ERROR:  could not create unique index
DETAIL:  Table contains duplicated values.

I did a select on the "tax" table, and this is what it contains (sorry it's a little mangled):

chart_id | rate |    taxnumber    |  validto
----------+------+-----------------+------------
    10019 |    0 |                 | 2006-06-30
    10019 | 0.06 | GSTNUMBER |
    10020 | 0.07 | PSTNUMBER         |
(3 rows)


I did not have a GST number before 2006-06-30, but now I do...so this means that the following key must be incorrect:

ALTER TABLE tax ADD PRIMARY KEY (chart_id);

Or am I missing something here?

I thank you in advance for any help you can provide.

Angus