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 1gHDEl-0003Ar-8K for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 19:30:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHDEj-0007jF-0F for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 19:30:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHDEi-0007j8-Ki for pgsql-general@lists.postgresql.org; Mon, 29 Oct 2018 19:30:04 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHDEg-0001eP-9P for pgsql-general@postgresql.org; Mon, 29 Oct 2018 19:30:03 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 06B06992D9 for ; Mon, 29 Oct 2018 12:30:01 -0700 (PDT) Date: Mon, 29 Oct 2018 12:30:01 -0700 (PDT) From: Rich Shepard To: "pgsql-general@postgresql.org" Subject: Re: Redirecting select() output generates error In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 29 Oct 2018, David G. Johnston wrote: > You can either use \out or \copy within psql script or redirect the shell > output using shell features. David, willamette-river-hg-# \out data-summary-by-form.txt willamette-river-hg-# select param, site_nbr, sampdate, min(quant), max(quant), unit from concentrations group by param, site_nbr, sampdate, unit order by param, site_nbr, sampdate, unit; ERROR: syntax error at or near "|" LINE 1: | 1980-05-08 | 0.5 | 0.5 | ug/L Still not working. Rich