Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYGOA-0003Xd-0l for pgsql-general@arkaria.postgresql.org; Wed, 27 Jun 2018 19:46:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYGO8-00089x-6Z for pgsql-general@arkaria.postgresql.org; Wed, 27 Jun 2018 19:46:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYGO7-00089n-Rn for pgsql-general@lists.postgresql.org; Wed, 27 Jun 2018 19:46:00 +0000 Received: from 24-182-127-154.static.stls.mo.charter.com ([24.182.127.154] helo=mail.brookhurstdata.net) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYGO4-000676-M8 for pgsql-general@lists.postgresql.org; Wed, 27 Jun 2018 19:45:57 +0000 Received: from mail.brookhurstdata.net (mail.brookhurstdata.net [10.1.5.12]) by mail.brookhurstdata.net (Postfix) with ESMTP id 8AD3288901D for ; Wed, 27 Jun 2018 14:45:55 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 27 Jun 2018 14:45:55 -0500 From: Susan Hurst To: pgsql-general@lists.postgresql.org Subject: Re: Space Stalker in SQL Output Organization: Brookhurst Data LLC Reply-To: susan.hurst@brookhurstdata.com Mail-Reply-To: susan.hurst@brookhurstdata.com In-Reply-To: <87zhzgauk2.fsf@jsievers.enova.com> References: <8ad8301badea6566622771129517cf02@mail.brookhurstdata.net> <87zhzgauk2.fsf@jsievers.enova.com> Message-ID: X-Sender: susan.hurst@brookhurstdata.com User-Agent: Roundcube Webmail/RCMAIL_VERSION List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Wow! The -A option worked perfectly! Thanks for the syntax lesson Steve and Jerry! Sue --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Susan E Hurst Principal Consultant Brookhurst Data LLC Email: susan.hurst@brookhurstdata.com Mobile: 314-486-3261 On 2018-06-27 14:38, Jerry Sievers wrote: > Susan Hurst writes: > >> Why would a psql statement insert a leading space into the output, >> which is a single integer value? >> >> The leading space caused my job call to fail elsewhere in the same >> shell script as the psql call. Here is the anonymized version of the >> psql call to assign a value to a shell script variable: >> >> IDz=`psql -d proddb -U produser -h 10.9.999.99 -p 99900 -t < >> last_id.sql` > > Get in the habit of including -A which gets rid of alignment padding in > psql output. > > As in... > > shellvar=`psql -Atqc 'select froboz;'` $db > > HTH