I would like to run an update as below on a 100 million row table in batches so as to not cause locking/without downtime and not affecting replication.

Update tbl
    set col_new = col
where (do 1 day at a time)
perform pg_sleep(120);

col is timestamp without time_zone, col_new is timestamptz

Can someone help me with the syntax?



Browse other questions tagged or ask your own question.