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 1erjL1-0001fi-NM for pgsql-docs@arkaria.postgresql.org; Fri, 02 Mar 2018 11:58:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erjL0-0005ac-3d for pgsql-docs@arkaria.postgresql.org; Fri, 02 Mar 2018 11:58:58 +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.89) (envelope-from ) id 1erjKz-0005aS-Te for pgsql-docs@lists.postgresql.org; Fri, 02 Mar 2018 11:58:57 +0000 Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1erjKv-00088b-Qe for pgsql-docs@postgresql.org; Fri, 02 Mar 2018 11:58:57 +0000 Received: by mail-qk0-x22d.google.com with SMTP id y137so11556033qka.4 for ; Fri, 02 Mar 2018 03:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZXZa+MqhWrQzSPrLz5XIcW7W5V7KD4HVBYEb8X5Xgiw=; b=0ZtKz3/oPi1D6Fn9/SSxwOpxRXr1bAxmWZmp8ofv7Ae0iNCaHVvYrcFnfHpyP0xBN1 USkyZfZplj0GmhNQPnwBxdCtPYOq9VgAP0RCP65sfTj4mNFiKAoZXPgN/bSe4SaD1jP9 BFd4frZnqEAQQV9VfzvmR3jj/jUBqy3vGaEjEi1sQ1kWwm/TGwAbFRMBpH6+oK8xJIFG 6fQmTwXZySlga1JYtiQHQxRq69J3Dg9Bjb3gq3KgNMRpuKiYvzxhiQjsEn24vVZxzGyR 2/SotPJbh2Z2NcsXb7TI35ESV1TJRGnhRu3GqLQlhTTELzNefpUjDTQF5gcB7hYPMR6f eV3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZXZa+MqhWrQzSPrLz5XIcW7W5V7KD4HVBYEb8X5Xgiw=; b=mKKGIjle1hE+w8sAo1WlMZjLKVFEFa87oMRDbHwC6ccfATXKFP+BfPtUBPOYOWCH7k y1w+5FQgGYJwoDxc9BV4Xi+aSbK5LGbBm8AqjrEwdDuidRgl3POBSRPsVdq6wLWtK6/j PTkh370I4Udl19ImKOBSKlpKTizaYol8tdJrIxu+BWaNyP9lHWXJy34CLNhXzAsgZFv+ P+8HPs4DowfPj5nHcjRMJ8GxRJVuSCzH0gujLlBrfTTq0/IeZ/koKFe0ZOeZAYfr7US5 Gzd45g7gzMDRtN2h45ulqGI1e0qQ1Yn995umwFUPACz00yPVMGa0WVf9h039sx5c5iD4 QXxA== X-Gm-Message-State: AElRT7HP8XQYMoEow5EXA/fZdH8vnOuC0c/9lQjDauFSA/s5ADoUX2kQ EeNGwv7ZTxw9T7svcxnsXhiuII+WKXyyMfOwJwI2rQ== X-Google-Smtp-Source: AG47ELsJRfzf+y+MaURUCKDgRCrN5gHkThd1tClOkSYiqiYuwN27GfMkqVvN7nYLeG2XsfXeABhcc4Tqo0TPi2g8lfg= X-Received: by 10.55.157.76 with SMTP id g73mr7902323qke.107.1519991931397; Fri, 02 Mar 2018 03:58:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.15.165 with HTTP; Fri, 2 Mar 2018 03:58:50 -0800 (PST) In-Reply-To: <20180302014938.GC1186@paquier.xyz> References: <20171122132714.1463.27247@wrigleys.postgresql.org> <20180301093554.qrqgdnfwgs77tj23@alap3.anarazel.de> <20180302014938.GC1186@paquier.xyz> From: Magnus Hagander Date: Fri, 2 Mar 2018 12:58:50 +0100 Message-ID: Subject: Re: libpq options To: Michael Paquier Cc: Andres Freund , Michael Paquier , Petr Jelinek , =?UTF-8?B?xZ5haGFwIEHFn8OnxLE=?= , pgsql-docs , Fujii Masao Content-Type: multipart/alternative; boundary="94eb2c05559221ff2c05666cb33e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --94eb2c05559221ff2c05666cb33e Content-Type: text/plain; charset="UTF-8" On Fri, Mar 2, 2018 at 2:50 AM, Michael Paquier wrote: > On Thu, Mar 01, 2018 at 01:35:54AM -0800, Andres Freund wrote: > > On 2017-11-25 19:05:54 +0900, Michael Paquier wrote: > >> A Boolean value of true tells the backend > >> + to go into walsender mode, wherein a small set of replication > commands > >> + can be issued instead of SQL statements. > > > > This actually is wrong now I think. Petr? > > On more or less HEAD: > $ psql -X -d "replication=1 dbname=postgres" > postgres=# create table aa (a int); > ERROR: cannot execute SQL commands in WAL sender for physical replication > $ psql -X -d "replication=database dbname=postgres" > postgres=# create table aa (a int); > CREATE TABLE > > So one needs to use replication=database in order to be able to issue > normal SQL statements, while replication=true enforces physical > replication where this cannot happen (no connection to a specified > database). > To nitpick: + protocol. A Boolean value of true tells the backend We don't really have boolean values here, do we? It's just the string true that's treated as a boolean by the backend. It just sounds really weird to me when written that way. Particularly since the next sentence talks about passing "database" as the same thing. I know that's pretty much nitpicking, but I want to make sure I haven't actually missed/forgotten how some part of that one is handled.. It also talks separately about "going into walsender mode" (=physical replication) and "instructs the walsender to connect to the database". I think that's a bit confusing. I suggest just calling it "physical replication mode" and "logical replication mode", and not bother mentioning walsender since that's quite internal. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/ --94eb2c05559221ff2c05666cb33e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Mar 2, 2018 at 2:50 AM, Michael Paquier <<= a href=3D"mailto:michael@paquier.xyz" target=3D"_blank">michael@paquier.xyz= > wrote:
On Thu, Mar 01, 2018 at 01:35:54AM -0800, Andres Fr= eund wrote:
> On 2017-11-25 19:05:54 +0900, Michael Paquier wrote:
>> A Boolean value of <literal>tr= ue</literal> tells the backend
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0to go into walsender mode, wherein a s= mall set of replication commands
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0can be issued instead of SQL statement= s.
>
> This actually is wrong now I think. Petr?

On more or less HEAD:
$ psql -X -d "replication=3D1 dbname=3Dpostgres"
postgres=3D# create table aa (a int);
ERROR:=C2=A0 cannot execute SQL commands in WAL sender for physical replica= tion
$ psql -X -d "replication=3Ddatabase dbname=3Dpostgres"
postgres=3D# create table aa (a int);
CREATE TABLE

So one needs to use replication=3Ddatabase in order to be able to issue
normal SQL statements, while replication=3Dtrue enforces physical
replication where this cannot happen (no connection to a specified
database).

To nitpick:

+=C2=A0 =C2=A0 =C2=A0 =C2=A0protocol. A Boolean value of <liter= al>true</literal> tells the backend

We do= n't really have boolean values here, do we? It's just the string tr= ue that's treated as a boolean by the backend. It just sounds really we= ird to me when written that way. Particularly since the next sentence talks= about passing "database" as the same thing.

=
I know that's pretty much nitpicking, but I want to make sure I ha= ven't actually missed/forgotten how some part of that one is handled..<= /div>

It also talks separately about "going into wa= lsender mode" (=3Dphysical replication) and "instructs the walsen= der to connect to the database". I think that's a bit confusing. I= suggest just calling it "physical replication mode" and "lo= gical replication mode", and not bother mentioning walsender since tha= t's quite internal.=C2=A0

--
=C2=A0Magnus Hagander
=C2=A0M= e: https://www.hagan= der.net/
=C2=A0Work: https://www.redpill-linpro.com/
--94eb2c05559221ff2c05666cb33e--