- App Store
ERROR: duplicate key value violates unique constraint
I am new to xTuple (and accounting for that matter.) I am trying to enter our beginning balances as instructed here: http://www.xtuple.org/EnteringOpeningBalances.
When I have finished entering the balances and I click POST, I get the following error:
ERROR: duplicate key value violates unique constraint "trialbal_pkey"
DETAIL: Key (trialbal_id)=(9149) already exists.
CONTEXT: SQL statement "INSERT INTO trialbal
( trialbal_id, trialbal_accnt_id, trialbal_period_id,
( _trialbalid, _r.gltrans_accnt_id, _r.period_id,
CASE WHEN (_r.gltrans_amount > 0) THEN _r.gltrans_amount
CASE WHEN (_r.gltrans_amount < 0) THEN (_r.gltrans_amount * -1)
PL/pgSQL function "postintotrialbalance" line 50 at SQL statement
SQL statement "SELECT postIntoTrialBalance(pSequence)"
PL/pgSQL function "postglseriesnosumm" line 96 at PERFORM
I don't know what this means or how to fix it. Does anyone know how to fix it?
Thu, 07/12/2012 - 10:03#1
Now I am getting the same
Now I am getting the same error while trying to update a user role's privileges:
ERROR: duplicate key value violates unique constraint "grppriv_pkey"
DETAIL: Key (grppriv_id)=(622) already exists.
CONTEXT: SQL statement "INSERT INTO grppriv
( grppriv_grp_id, grppriv_priv_id )
( pGrpid, pPrivid )"
PL/pgSQL function "grantprivgroup" line 20 at SQL statement
Fri, 07/13/2012 - 16:26#2
Sun, 07/15/2012 - 23:20#3
Well... in the absence of any
Well... in the absence of any better suggestions, I backed up my database, fired up pgAdmin, and went poking around for a table called trialbal.
After awhile I did find a table called trialbal with about 2,500 entries, each with a $0 debit and a $0 credit entry. Since I didn't enter any financial transactions yet (I encountered this problem when I was entering the opening balances), I selected all the records in the trialbal table and deleted them. Then I tried again to post my opening balances and it posted without error!
Everything *seems* to be working normally for the last few days. I'm sure there is a better way to fix this problem, however I have don't know a better way. If anyone knows please share because I really want to know.