Working with repeatable read
With the video in mind, let's do some hands on work with a repeatable read transaction. We want to set a "stability" factor for a bank's in-house assets if they allow consumer deposits. We'll do this by setting a custom field, FIELD48, equal to a retainer value if the bank allows consumer deposit accounts as indicated in RCONP752.
Interference from an external transaction would alter the application of our factor. Repeatable read protects your transaction from outside sources changing data that was available to us when we ran our first query in the transaction.
Este ejercicio forma parte del curso
Transactions and Error Handling in PostgreSQL
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
-- Create a new transaction with a repeatable read isolation level
___ ___ ___ ___ ___ ___;
-- Update records for banks that allow consumer deposit accounts
UPDATE ffiec_reci
SET FIELD48 = 100
WHERE RCONP752 = 'true';
-- Update records for banks that do not allow consumer deposit accounts
UPDATE ffiec_reci
SET FIELD48 = 50
WHERE RCONP752 = 'false';
-- Commit the transaction
___;