Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aUz2x-0002u2-Tv for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Feb 2016 15:57:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aUz2x-0002gQ-Am for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Feb 2016 15:57:15 +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) (envelope-from ) id 1aUz2x-0002gK-1V for pgsql-bugs@postgresql.org; Sun, 14 Feb 2016 15:57:15 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aUz2u-0002Av-Ig for pgsql-bugs@postgresql.org; Sun, 14 Feb 2016 15:57:14 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id C61783AEDC5; Sun, 14 Feb 2016 16:57:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (pD9F6BB0E.dip0.t-ipconnect.de [217.246.187.14]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 95FB03AEDC3; Sun, 14 Feb 2016 16:57:08 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 2CB29109538; Sun, 14 Feb 2016 16:57:08 +0100 (CET) Date: Sun, 14 Feb 2016 16:57:08 +0100 From: Andres Freund To: Tom Lane Cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: Standbys using commas in application_name cannot become sync nodes Message-ID: <20160214155708.GD9490@awork2.anarazel.de> References: <17378.1455465061@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17378.1455465061@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2016-02-14 10:51:01 -0500, Tom Lane wrote: > Michael Paquier writes: > > Commas are authorized characters in application_name for a node in > > recovery, however this overlaps with the fact that > > synchronous_standby_names uses commas as a separator for each node > > name. So, if a standby node uses a comma in its name, even if its name > > is set in s_s_names it can never become a synchronous node because > > SplitIdentifierString() splits this parameter with only a comma. > > > Even if I have never seen an standby using a comma in its > > application_name, this is a bug, and here are a couple of things that > > we could do regarding it: > > 1) Do not care, who is actually going to use a comma in application_name?! > > 2) Forbid the use of commas in application_name > > 3) Enhaunce a bit s_s_names splitting so as it can consider > > backslash+comma as part of a standby name. In short by setting > > s_s_names = 'foo\,bar', a standby with name 'foo,bar' would be a sync > > node. > > 4) Document the limitation and discourage the use of commas in application_name > > (3) seems like a mess with likely side-effects on other uses of > SplitIdentifierString. I'd vote for (2) or (4). I know a number of applications written by clients, without my encouragement, that use application name to provide e.g. the application user triggering queries. At least two had used commas at some point. So I'm disinclined to go with 2). Andres -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs