pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: van Elsacker Frans <fve@atbib.be>
To: pgsql-sql@postgresql.org
Subject: multiple insert
Date: Wed, 29 Sep 2004 19:12:47 +0200
Message-ID: <415AED0F.1010909@atbib.be> (raw)

We developed a program to follow up the time one is working on a 
particular job. They start and stop the time counter different times a 
day, now for already tree years.  Everything works fine but for a short 
while (august?) there are very few actions  from which the beginning 
time is inserted twice, even three times, without special reason. Now 
this occurs a mean of once/two days. We disabled the possibility of 
double clicking on the insert button to avoid double inserting but it 
did not help. The table has appr 40.000 records now.
Employes have same working times and lunch times.( more ticks can have 
same second for start)
vacuum runed.
Can the problem be caused by a heavy loaded server??
 
The structure of the table is :
CREATE TABLE tikbezig (
    ordernr character(6) NOT NULL,
    lijnnr character(2),
    afdeling character(2),
    werknr character(5),
    begintijd timestamp with time zone,               --startime
    eindtijd timestamp with time zone,               --endtime
    begincomp character varying(20),                  -- computername 
startjob
    eindcomp character varying(20),                  --computername endjob
    oo integer,
time zone
);

ordernr is not unique but has a index

CREATE INDEX tikbezig_idx ON tikbezig USING btree (ordernr, lijnnr, 
afdeling);

CREATE INDEX tikwerkn_idx ON tikbezig USING btree (werknr);

CREATE CONSTRAINT TRIGGER "<unnamed>"
    AFTER INSERT OR UPDATE ON tikbezig
    FROM werkn
    NOT DEFERRABLE INITIALLY IMMEDIATE
    FOR EACH ROW
    EXECUTE PROCEDURE "RI_FKey_check_ins"('<unnamed>', 'tikbezig', 
'werkn', 'UNSPECIFIED', 'werknr', 'nr');

example
13474     01    NA        3    2004-09-24 11:02:50    2004-09-24 
11:09:43    NAAIAFDELING    NAAIAFDELING        2004-09-24 11:09:28
13474     01    NA        3    2004-09-24 11:02:50    2004-09-24 
11:09:35    NAAIAFDELING    NAAIAFDELING        2004-09-24 11:09:31
13474     01    NA        3    2004-09-24 11:02:50    2004-09-24 
11:10:12    NAAIAFDELING    NAAIAFDELING        2004-09-24 11:09:26
which means same computer, same person, same order on same second.

Any help is welcome

Frans



Message-ID: <415AED0F.1010909@atbib.be>
Permalink:  ../415AED0F.1010909@atbib.be/
Also on:    postgresql.org/message-id/415AED0F.1010909@atbib.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fve@atbib.be
  Subject: Re: multiple insert
  In-Reply-To: <415AED0F.1010909@atbib.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox