pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Susan Hurst <susan.hurst@brookhurstdata.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Space Stalker in SQL Output
Date: Wed, 27 Jun 2018 14:45:55 -0500
Message-ID: <eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net> (raw)
In-Reply-To: <87zhzgauk2.fsf@jsievers.enova.com>
References: <8ad8301badea6566622771129517cf02@mail.brookhurstdata.net>
	<87zhzgauk2.fsf@jsievers.enova.com>

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 <susan.hurst@brookhurstdata.com> 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




view thread (4+ messages)  latest in thread

Message-ID: <eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net>
Permalink:  ../eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net/
Also on:    postgresql.org/message-id/eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: susan.hurst@brookhurstdata.com
  Subject: Re: Space Stalker in SQL Output
  In-Reply-To: <eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net>
  References: <8ad8301badea6566622771129517cf02@mail.brookhurstdata.net> <87zhzgauk2.fsf@jsievers.enova.com> <eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox