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 1egjsQ-0007LQ-JI for pgsql-general@arkaria.postgresql.org; Wed, 31 Jan 2018 04:20:02 +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 1egjsP-0002p4-DQ for pgsql-general@arkaria.postgresql.org; Wed, 31 Jan 2018 04:20:01 +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 1egjsP-0002oi-5L for pgsql-general@lists.postgresql.org; Wed, 31 Jan 2018 04:20:01 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egjsL-0003rW-Pd for pgsql-general@postgresql.org; Wed, 31 Jan 2018 04:20:00 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 16C9D2093F; Tue, 30 Jan 2018 23:19:56 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Tue, 30 Jan 2018 23:19:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nouIVO QmwAMaqgDCMEyc/Ah8gm+YNd4pm5dqh1Oylw8=; b=PhOVU5RhIQYzzposSgFqil 3XWwbL3gGr6E+ZK9pFOZJZlBI84JXbmBZeNkg0xUaEwGsOy/WtnIZB5MtCm3duo5 oVVyYY5G/36/fHHSzZL7cMq0W8Q0U240WkecBFELnRtVoOiACFVk+B/qWI/3TNS+ G9+h8iMCalBE1wNwzaPBfxot6s06k7B1hfiOix5n9DpEFMR2iOe+205fnDFXzZun KaV/kXy17cKEP2CadQk7ugxleQrBKa7sxYc9vBBnies/vksYY0TFk4mNwiIMSnfp bM8C1p1OA18kDH3sVatqQ6JW/lK1GiYffw7iX99BWVWPUiBKaNgfl8i6WRYWrZVA == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id BBE5D7E17D; Tue, 30 Jan 2018 23:19:55 -0500 (EST) Subject: Re: session_replication_role meaning? To: Luca Ferrari , pgsql-general References: From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <798351cb-5023-db40-8d7c-07387d4ce389@2ndquadrant.com> Date: Tue, 30 Jan 2018 23:19:55 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/30/18 02:48, Luca Ferrari wrote: > Hi all, > 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'. The documentation was recently updated in the master branch, so maybe you will find this explanation a bit more detailed: https://www.postgresql.org/docs/devel/static/runtime-config-client.html#GUC-SESSION-REPLICATION-ROLE > I've a logical replication setup and both master and client > connections default to 'origin', so it has to be specified manually. The global setting for an instance is not affected by whether you are replicating. The replication system is supposed to set the parameter when it is applying changes, e.g., https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/replication/logical/worker.c;h=eedc3a8816bc2f157e62a664bcc57b5f87530be9;hb=958fe549884928cd3bdf009993e9a05df5fd6cee#l1521 -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services