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

Re: Postgres Access Timing

-----Original Message-----
From: Chris Travers <..hidden..>
To: ..hidden..
Sent: Sat, 25 Jul 2009 17:41
Subject: Re: [Ledger-smb-users] Postgres Access Timing

On Sat, Jul 25, 2009 at 2:24 AM, beamends <..hidden..> wrote:

On Fri, 2009-07-24 at 10:05 -0700, Chris Travers wrote:
> How are you determining the customer/vendor that was inserted as well
> as the part?

The vendor is a set depending on which file is being processed. For now
anyway it's hardcoded from looking at the vendor table with phppgadmin.

Much safer to use SELECT currval('id');
What if someone else inserts a vendor between when you do and when you look?

I'm not using the customer bits of a part at the moment. The part_id is
got from the part when created.

SELECT currval('id') works here too.  Both tables use the 'id' sequence though that will be changing in 1.3.
Otherwise, you could get timing issues.

Best Wishes,
Chris Travers

Hi Chris,
I don't know if you've got my last post yet. I'd just add that partsvendor is still taking quite a while to "get ready", but since I took out the bits mentioned there it is a lot better. Thinking back this probably might tie in with some posts I made about unique id errors a long while back - when adding a vendor through the LSMB parts window it very often takes two or three attempts to insert. There does seem to be something funny going on there. Or is it just me because of the size of the dabse may be?

Ledger-smb-users mailing list