Re: Parallel Insert and Delete operation - Mailing list pgsql-general

From Yelai, Ramkumar IN BLR STS
Subject Re: Parallel Insert and Delete operation
Date
Msg-id 13D0F6C9B3073A4999E61CAAD61AE7ECC5E84B1704@INBLRK77M2MSX.in002.siemens.net
Whole thread Raw
In response to Re: Parallel Insert and Delete operation  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
Ramkumar Yelai wrote:
[is worried that a database might become inconsistent if conflicting INSERTs and DELETEs occur]
> @Albe  - I  got you first point. The second point is little skeptical
because postgres could have been
> avoided this lock by using MVCC. Please correct me if I am wrong?

Which lock could have been avoided?

PostgreSQL locks rows when the data change.
That has little to do with MVCC.

If you INSERT into a table that has a foreign key, the referenced row in the referenced table gets a SHARE lock that
conflictswith the EXCLUSIVE lock required for a DELETE. 
So they cannot execute concurrently.

Yours,
Laurenz Albe

Thanks very much Albe.

I am not aware of that, delete will lock the table.


pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Memory issue on FreeBSD
Next
From: Raymond O'Donnell
Date:
Subject: Re: How to verify pg_dump files