Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres Table lock on delete query

I have two aws task where one could be writing to table another could run delete query at the same time both could be running parallel queries but playing with different rows. so the question is if I run delete from table where column_name=some condition ? then will postgres apply table level lock or row level lock. If table level lock gets applied then another task will not able to write into table.

like image 740
pravinbhogil Avatar asked Sep 19 '25 00:09

pravinbhogil


1 Answers

PostgreSQL will only lock the rows you delete.

Concurrent INSERTs will not be affected.

like image 99
Laurenz Albe Avatar answered Sep 21 '25 15:09

Laurenz Albe