Re: Design question regarding arrays - Mailing list pgsql-novice

From Oliver Fromme
Subject Re: Design question regarding arrays
Date
Msg-id 200408091029.i79ATRv3053414@lurza.secnetix.de
Whole thread Raw
In response to Re: Design question regarding arrays  ("Sean Davis" <sdavis2@mail.nih.gov>)
Responses Re: Design question regarding arrays
List pgsql-novice
Sean Davis wrote:
 > I'm a novice, too, but why not look up the value in the sequence and
 > increment it before doing any inserting?  If you are doing all the inserts
 > at the same time (more or less), then you can just use this value in the
 > insert into both tables.  Put all of this inside one transaction.

That won't work if another process is trying to do the same
thing at the same time.  They both get the same value when
they look it up, so there will be an ID collision.

Best regards
   Oliver

--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Being really good at C++ is like being really good
at using rocks to sharpen sticks."
        -- Thant Tessman

pgsql-novice by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Design question regarding arrays
Next
From: Stephan Szabo
Date:
Subject: Re: Design question regarding arrays