4

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.

0

2 Answers 2

4

PostgreSQL will only lock the rows you delete.

Concurrent INSERTs will not be affected.

Sign up to request clarification or add additional context in comments.

Comments

2

There are many different lock modes. The table will be locked, but in a mode that still allows other INSERT, DELETE, and UPDATE operations to happen concurrently. The rows actually deleted will also be locked, in a more restrictive mode.

1 Comment

Any documentation for this i.e. Rows being deleted are locked ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.