Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRcKf-0003Xr-ME for pgsql-general@arkaria.postgresql.org; Tue, 08 Mar 2022 16:05:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRcKe-0002tz-FT for pgsql-general@arkaria.postgresql.org; Tue, 08 Mar 2022 16:05:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRcKd-0002tq-Sr for pgsql-general@lists.postgresql.org; Tue, 08 Mar 2022 16:05:04 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nRcKa-0001Jk-Uh for pgsql-general@lists.postgresql.org; Tue, 08 Mar 2022 16:05:02 +0000 Received: by mail-ej1-x634.google.com with SMTP id qx21so40258379ejb.13 for ; Tue, 08 Mar 2022 08:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=aJ1ZGkHzuJq6U5Yu3jI2zPCiojxMK7AWUbu7NO35pkI=; b=gswrjwd5a8VkWa5D1Waccb8dTCxSYsndW8WZJ12N5kJx6Wr2RsyvfEtmeNbgd8rqWf Yt4qfEMZU2pszpWQRK9DYCzjhpv8EBtzPq+1dJMT/6zjb/b51+SbaIgXThXKE5GdENtc 0FW0ufY4H9dYLVlNZNEY1n18Mo4aJsrjbGbSKsPBH1LYoI42OSaCSaUCM+dO1othWaD+ Hc/I6Ha6Hh1NBEfIJZnaT3pD6aMSsOuH5h1ExQjnt6QJvNjz0fpILpLKPofpZKWLNDZs oA1xdrr3kc5zzzqtSN0aZk4aeVBSIWBlVeuBl5DjM4mpxtA/2Er6yIJL5ZkuPFKP/mHt 5+ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=aJ1ZGkHzuJq6U5Yu3jI2zPCiojxMK7AWUbu7NO35pkI=; b=a8noSiumqU1GwGtW12LnyO8HJyHp4qqlvEyLGA5pl8DbpoO8lNJkA6qx9wDH0rT5Fj HcpwolRqfcjT2vhFHYjp6dqj7VEsSNmBEZRXyM8b7n/pTzd9sdRLxo4MU2MSem54NN8a awPAKNtq7IyJYHJGRZ7SPbNxUwXZtpknGPuj18T97t/uNVqifrGEArabfuJc723/ZsHc Q4PMN/RRrzqFOtiuF0f9yBJoZ3ISWUC1TtD8WXNKl9JNRvN7krkSwrY9TgPmfA38DbX4 AYS0T/DmBoLIvjlZis06J3yzzQZj96NSojpEXG21ScQU+VRVbD4GHdIkIRN5mLqdocgO R6Bg== X-Gm-Message-State: AOAM530dMB+MRb1kM6h7RAwxuDYq5ixobCM+3bPVCynFtm+wTVrs00Ok HLD3Aj5yYbOZHJL7toCrNDvQQg== X-Google-Smtp-Source: ABdhPJwB7G1Hp9NdKrCujp6wrU75de8FMQcSYfDbY8YBDBl5Gjg0KLFwXkIADyyrRyhFf/AyYswEyw== X-Received: by 2002:a17:907:72c3:b0:6da:b4d1:415a with SMTP id du3-20020a17090772c300b006dab4d1415amr13610745ejc.709.1646755498458; Tue, 08 Mar 2022 08:04:58 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:1afe:32b0:4c90:c0f:c923]) by smtp.gmail.com with ESMTPSA id d4-20020a1709067a0400b006d6e3ca9f71sm6113051ejo.198.2022.03.08.08.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 08:04:58 -0800 (PST) Message-ID: Subject: Re: Serializable read only deferrable- implications From: Laurenz Albe To: Michael Lewis , PostgreSQL General Date: Tue, 08 Mar 2022 17:04:57 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-3.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2022-03-08 at 06:29 -0700, Michael Lewis wrote: > "The DEFERRABLE transaction property has no effect unless the transaction is also > SERIALIZABLE and READ ONLY. When all three of these properties are selected for a transaction, > the transaction may block when first acquiring its snapshot, after which it is able to run > without the normal overhead of a SERIALIZABLE transaction and without any risk of contributing > to or being canceled by a serialization failure. This mode is well suited for long-running reports or backups." > > > Could anyone expound on the above? What are the real life differences between the two commands below? Would this be applicable at all to sessions on a physical replica? > > SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; > > SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; A transaction started with the first statement will not take any SI locks, nor will it ever receive a serialization error. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com