Re: Concurrent Inserts

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "sri harsha *EXTERN*" <sriharsha9992(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Concurrent Inserts
Date: 2015-01-21 11:33:47
Message-ID: A737B7A37273E048B164557ADEF4A58B3658E33B@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

sri harsha wrote:
>>> Is there any way to stop concurrent inserts to happen on a single table ??

>> If you really want that, it is easy with table locks.

> Actually i am using a FDW , in which the data is written into a single file. So when i do
> concurrent inserts , the data is written into the file simultaneously and this is causing a data
> corruption . Is TABLE LOCK the only option available ??

In that case I would say that the FDW is broken.

If concurrent modifications corrupt the data, the FDW should make sure that not more
than one modification to the same data can happen at the same time, perhaps by using
PostgreSQL advisory locks or IPC mechanisms.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Spiros Ioannou 2015-01-21 12:03:21 Re: partitioning query planner almost always scans all tables
Previous Message sri harsha 2015-01-21 11:15:19 Re: Concurrent Inserts