From: | "Robert D(dot) Nelson" <RDNELSON(at)co(dot)centre(dot)pa(dot)us> |
---|---|
To: | Jarmo Paavilainen <netletter(at)comder(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: MySQL and PostgreSQL speed compare |
Date: | 2000-12-29 19:08:00 |
Message-ID: | 3A478C2A@rba6.rbapro.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>Make a SELECT to check if the row exist.
>If not it make a INSERT, or if its there it make an UPDATE (or something
>totally different).
>
>Everything is swell, but when several pids are trying to insert there is a
>window of error between the SELECT and INSERT. And the test program
>triggered it frequently. What if there were a lot of insert/updated before
>and after the failing one (inside this transaction) and it would be ok if
>this row was inserted by someone else. The dba does not know about that, *I
>do* and can write my program in such a way.
>
>How do you fix that in PostgreSQL! The only way I know of is not to use
>transactions. Then if the INSERT fails you can try again with SELECT to
>check if the row has been inserted by someone else. And ofcourse you would
>need to build your own rollback function.
>
>The "all or nothing approach" ala PostgreSQL is broken!
>
>Nuff about transactions. I do not think I can convince you and you cant
>convince me about that they are not. And why do you not check how the other
>dbas has solved this. I bet they work as I describe.
Wouldn't it be smart to make the select and insert a transaction, and if it
fails, then start an update?
Rob Nelson
rdnelson(at)co(dot)centre(dot)pa(dot)us
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2000-12-29 19:08:02 | Re: SV: MySQL and PostgreSQL speed compare |
Previous Message | Mikheev, Vadim | 2000-12-29 19:02:39 | RE: MySQL and PostgreSQL speed compare |