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

Re: Tax rate changes and constraint "tax_pkey



For now, it is the preferred answer, but if you want to use Slony, this causes problems and you want to discuss ways forward on the list (and perhaps be a part of testing a better solution).

I expect that in 1.3, we will be revisiting how this table works so we can add a better primary key.  My current thinking is to change the date field to a timestamp with an infinity default and make a composite key.

After all, NULL in this case really means "Not obsolete yet" which is probably semantically inaccurate and this is a part of the problem.

Best WIshes,
Chris Travers

On 5/9/07, Angus Jordan <..hidden..> wrote:
Hello all,


Ok, I think we had talked about this before, but a general decision was not
made.  When you expire a tax rate and go to add the new rate, you will have a
problem:

DBD::Pg::st execute failed: ERROR: duplicate key violates unique
constraint "tax_pkey"
Error!

INSERT INTO tax (chart_id, rate, taxnumber, validto,
pass, taxmodule_id)
VALUES (?, ?, ?, ?, ?, ?)
ERROR: duplicate key violates unique constraint "tax_pkey"

Is the current solution to remove the primary key for tax?


I would also like to know if removing this primary key is the permanent solution.  Perhaps there is a simple DB change that can be made to allow for tax rate changes?

I look forward to a reply on this topic.

Regards,
Angus Jordan