Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3jdl-0007Ix-CN for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 16:20:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3jdj-0004C1-LD for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 16:20:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3jdj-00043w-72 for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 16:20:43 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i3jdc-0001km-Ph for pgsql-general@postgresql.org; Fri, 30 Aug 2019 16:20:42 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 4CBEF9939A for ; Fri, 30 Aug 2019 09:20:34 -0700 (PDT) Date: Fri, 30 Aug 2019 09:20:34 -0700 (PDT) From: Rich Shepard To: pgsql-general@postgresql.org Subject: Re: Escape parentheses in aggregate function In-Reply-To: <26321.1567178286@sss.pgh.pa.us> Message-ID: References: <26321.1567178286@sss.pgh.pa.us> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 30 Aug 2019, Tom Lane wrote: > I think your problem is the line break, not the parentheses. psql knows > how to count parens, but it has no concept of letting backslash commands > continue across lines. Tom, Interesting. I've adopted separating select statements by their expressions as it makes it easier for me to get it right, or fix it. However, I can put it all on a single line once I know the syntax is correct and I add the \copy() function. Thanks, Rich