How to refresh table with deadlock?

Grover, Jyoti 40 Reputation points
2024-04-03T18:34:12.2933333+00:00

We Azure postgresql database build. on that we have a ADF process that is doing truncate and load from source schema to prod schema every morning. Teams are querying to prod schema continuously to pull data which causes deadlock on table. then adf load from source to prod fails. How can we refresh table in prod without getting rid of deadlock?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,570 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,896 Reputation points
    2024-04-04T05:24:24.96+00:00

    truncate and load from source schema to prod schema

    If you do a full load to an empty table, then the complete table gets locked; that's quite normal.

    In PostgreSQL you can set the transaction isolation to "READ UNCOMMITED" to read the "new" data anyway, see https://www.postgresql.org/docs/8.4/transaction-iso.html


  2. ShaikMaheer-MSFT 37,896 Reputation points Microsoft Employee
    2024-04-12T05:28:36.2833333+00:00

    Grover, Jyoti,

    After read completes from teams deadlocks usually get self removed.

    Hope this helps.


    Please consider hitting Accept Answer button. Accepted answers help community as well.