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 1gHD6L-0002r8-SP for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 19:21:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHD6H-0006ZQ-Kh for pgsql-general@arkaria.postgresql.org; Mon, 29 Oct 2018 19:21:21 +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 1gHD6H-0006ZD-CT for pgsql-general@lists.postgresql.org; Mon, 29 Oct 2018 19:21:21 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHD6F-0006SO-Co for pgsql-general@postgresql.org; Mon, 29 Oct 2018 19:21:20 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 0A25D992D9 for ; Mon, 29 Oct 2018 12:21:17 -0700 (PDT) Date: Mon, 29 Oct 2018 12:21:16 -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; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 29 Oct 2018, David G. Johnston wrote: > You seem to need to distinguish between the command line options to psql > and the meta commands that can be used within a script that is being > executed by psql. David, I'm running psql in a shell buffer within emacs, not at the shell prompt. The entire script is: \o data-summary-by-form.txt 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; \o This generates the error. Other backslash commands, such as \d work, but both \o and \g produce the error when followed by the select command. Rich