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

Re: Problem With Saving Parts



On Wed, 2009-12-09 at 22:28 +0800, David Godfrey wrote:
> Hi Rich and Beamends,
> 
> I would be hesitant to suggest this path without chatting with Chris T
> or one of the other developers first.
> The code is, I think, correct.
> I suspect that there is a problem elsewhere, most likely with the
> underlying database.
> 
> What version are you running, was the DB setup for this version from
> scratch, or was the DB migrated from an earlier version?
> Also do you have any modified code in LSMB?
> I guess it would make sense to ask what version of what OS you are
> running and also what version of postgresql.
> 
> These answers may help the experts answer more quickly.
> 
> One more question, how many items do you have in inventory?
> 
> I have about three thousand items in mine, with no problems and know
> that there are others with many more.
> Until now I have not heard of any reports about this problem.
> 
> One thing I have noticed though, if you try and define multiple "Make
> and Model" entries for a part you will always get errors (I think they
> are "duplicate key" errors, but it has been a while).
> Never had a problem with multiple vendors though.
> 
> Regards
> David G
> 

Fair comment... 

it's 

LSMB 2.1.18
Postgres 8.2 (might be 8.3 though..... see below)
Ubuntu 9.04  and a bit (see below)

Postgres has only ever been installed for use with LSBM, the upgrade to
Ubuntu 9.10 didn't go too well, hence the "and a bit"! Postgres 8.2 and
8.3 are installed - I'm not sure how to find out which one is actually
being used. LSMB stared out at about 2.1.8 or something and has been
upgraded several times. It's Apache2 and the latest Firefox (which is a
bit flakey, but not relevant I think). 

However, I've always had this problem (but not so bad) since the dbase
got past about 20,000 lines (or records if you prefer) - it's just
started getting really irritating now, so I'm pretty sure it's a
LSMB/Postgres interaction problem related to the size of the dbase.


Cheers
Richard 

> 
> Rich Shepard wrote: 
> > On Wed, 9 Dec 2009, beamends wrote:
> > 
> >   
> > > "DBD::Pg::st execute failed: ERROR: duplicate key violates unique
> > > constraint "partsvendor_pkey" at LedgerSMB/IC.pm line 529.
> > > 
> > > Error!
> > > 
> > > INSERT INTO partsvendor
> > > (vendor_id, parts_id,
> > > partnumber, lastcost,
> > > leadtime, curr)
> > > VALUES (?, ?, ?, ?, ?, ?)
> > > ERROR: duplicate key violates unique constraint "partsvendor_pkey"
> > > "
> > >     
> > 
> > Richard,
> > 
> >    I'm not a perl coder, nor a LSMB developer, but I've encountered this type
> > of SQL error in my approximate reasoning models. The problem is the existing
> > key and the solution is to write the SQL statement as:
> > 
> >    INSERT or REPLACE into ...
> > 
> >    If the primary key does not exist the new row is inserted; else if the primary
> > key exists, the column attribute values are replaced with those in the
> > statement.
> > 
> >    An alternative approach to accomplishing the same thing is to first "DELETE
> > from <tablename> where ..." followed by the INSERT statement.
> > 
> > HTH,
> > 
> > Rich
> > 
> > 
> > ------------------------------------------------------------------------------
> > Return on Information:
> > Google Enterprise Search pays you back
> > Get the facts.
> > http://p.sf.net/sfu/google-dev2dev
> > _______________________________________________
> > Ledger-smb-users mailing list
> > ..hidden..
> > https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
> > 
> >   
> 
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Ledger-smb-users mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-users