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 1lj0xb-0006on-9j for pgsql-admin@arkaria.postgresql.org; Tue, 18 May 2021 14:44:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lj0xa-0003fa-9b for pgsql-admin@arkaria.postgresql.org; Tue, 18 May 2021 14:44:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lj0xZ-0003fS-WA for pgsql-admin@lists.postgresql.org; Tue, 18 May 2021 14:44:38 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lj0xX-0007nQ-Ld for pgsql-admin@lists.postgresql.org; Tue, 18 May 2021 14:44:37 +0000 Received: by mail-ej1-x633.google.com with SMTP id et19so7932978ejc.4 for ; Tue, 18 May 2021 07:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=cybertec; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=0o/V0gP1+abQdz05k0QxzByYtOUiNL3ZGolZgBdGz+A=; b=jWRJnGuuDQYOlP//HpVviWbsCiHS+gJ6yJPIhhNLOcwUIdBA6DhN6itw9eZ3mXzftg mXq3DdKcJEXYLcZGaBlv2duuigZqGdGMTEybqeEnCA/+7ObQc6fVmcBu41mb9431tKng qnApPkS4bJe4LW2G4j8s8aUNLqxDlC3glZF9Z8OpvaMu9Jai2dcenCos4N6icOxs9uul sjPsbabzD77cc0wxF0hP12zMl/pdPV1OsxeBd0bMB/EoWlpubWcAAUACFEkt3apIuU1L qrYsudg4H104Bf175VMIwUMxVST/ttKoSAsTfnkUsrKUQVCfrzl9tjtdA0qp0E5FIu8N DPEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=0o/V0gP1+abQdz05k0QxzByYtOUiNL3ZGolZgBdGz+A=; b=eOnPASPKTAUhGGapSwxUsGAjC69151B1OJlvNyuLsJpm3BRVCkS9SH/q27LPXzJu19 368wc0U6HN2uEGS6z3c1e+xyHZ4cizHLCpY9CRGwyReZ6/jA59KoCLrp9i0XEo3/JPWe Cr3+9Bpdc4pKdT7gBt906leY3RcuAZmvGOj5dBmTl4stcxp+GKlSgsI/eQJEcc6DXfeb xr7Jg4qmQ0HEne1OM+tB8x1w0sF1dslPb5v7y6HnrfoWuJHCArNpOCJY4rbklEkWgHdJ s5LGxSpRRIH/78CuQ72UficoblUHykgqvbWo4I/AdqoF+T+ZpXv2slmdyprIow1KqvpG cMDw== X-Gm-Message-State: AOAM532cAw2NlBsXdlGSubSYkEu8DxvQ57jk5P2OmClIaKLJElnsA/Ac OTR+BMLGaoeHKZJiHjL3V6p5Nw== X-Google-Smtp-Source: ABdhPJysK4yUYGMuJhp17b+sEmTsr96G6TSbD4lf/DQiekQHKM1xio1tvoHFajO5BaRcTRVUyVrZrA== X-Received: by 2002:a17:906:3419:: with SMTP id c25mr6330365ejb.96.1621349073975; Tue, 18 May 2021 07:44:33 -0700 (PDT) Received: from localhost.localdomain (217-149-174-207.nat.highway.telekom.at. [217.149.174.207]) by smtp.gmail.com with ESMTPSA id a6sm5593832ejv.4.2021.05.18.07.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 07:44:33 -0700 (PDT) Message-ID: <49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at> Subject: Re: FDW, connections, master v replica From: Laurenz Albe To: "Godfrin, Philippe E" , pgsql-admin@lists.postgresql.org Date: Tue, 18 May 2021 16:44:33 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2021-05-18 at 13:57 +0000, Godfrin, Philippe E wrote: > Does anyone know of a method to define a foreign server to point to a patroni > cluster of 2 postgres cluster instances and be able to select between the master for RW and the replica for RO? Use the "target_session_attrs" connection parameter. It can be used to always connect to the primary, and from v14 on it can also be used to preferably connect to the standby. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com