Concurrent Inserts

From: sri harsha <sriharsha9992(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Concurrent Inserts
Date: 2015-01-21 09:36:12
Message-ID: CAP6OGLEAx_o1p=1D0NBu=0b8ARROH60dRzVGc3ca3QpAXixKrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there any way to stop concurrent inserts to happen on a single table
??

Query 1 : INSERT INTO TABLE_A SELECT * FROM TABLE1;
Query 2 : INSERT INTO TABLE_A SELECT * FROM TABLE2;
Query 3 : SELECT * FROM TABLE_A;

Assume i have the above queries. Query 1 and Query 3 can occur concurrently
. If one insert is taking place , the other should wait. How do i achieve
this ??

How do the concurrent inserts take place in postgres ?? Is data stored
temporarily for both queries separately and then written into the table ??

Thanks,
Harsha

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-01-21 09:52:02 Re: Concurrent Inserts
Previous Message deans 2015-01-21 08:33:40 Re: BDR Error restarted