Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egRPH-0004Sj-8H for pgsql-general@arkaria.postgresql.org; Tue, 30 Jan 2018 08:36:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egRPG-0006WA-1p for pgsql-general@arkaria.postgresql.org; Tue, 30 Jan 2018 08:36:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1egRPF-0006Vx-QP for pgsql-general@lists.postgresql.org; Tue, 30 Jan 2018 08:36:41 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1egRP8-0003EK-Po for pgsql-general@postgresql.org; Tue, 30 Jan 2018 08:36:41 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2B81140F1B; Tue, 30 Jan 2018 09:36:32 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id DHc1nDM6sU5g; Tue, 30 Jan 2018 09:36:30 +0100 (CET) Message-ID: <1517301376.2517.14.camel@cybertec.at> Subject: Re: session_replication_role meaning? From: Laurenz Albe To: Luca Ferrari , pgsql-general Date: Tue, 30 Jan 2018 09:36:16 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Luca Ferrari wrote: > now this should be trivial, but I cannot udnerstand what is the > purpose of session_replication_role > or better, when I should use it in a way different from 'origin'. It is used to enable or disable triggers. By default, tables are created with all triggers enabled, which means that they fire with the default setting "session_replication_role = origin". You can change "session_replication_role" to "replica" to disable the firing of triggers (unless they are set ENABLE REPLICA or ENABLE ALWAYS). This is done by the logical replication apply worker, but you can also use it to bypass triggers, e.g. to speed up operation, if you know what you are doing. What is confusing is that there are three settings for "session_replication_role", but the two settings "local" and "origin" have the same meaning. Maybe that was meant to change at some point, but I see no explanation in the original discussion. Yours, Laurenz Albe