Re: Space Stalker in SQL Output

From: Susan Hurst <susan(dot)hurst(at)brookhurstdata(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Space Stalker in SQL Output
Date: 2018-06-27 19:45:55
Message-ID: eccb720e4e62d02dccafdc12ad46ec6d@mail.brookhurstdata.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)hurst(at)brookhurstdata(dot)com
Mobile: 314-486-3261

On 2018-06-27 14:38, Jerry Sievers wrote:
> Susan Hurst <susan(dot)hurst(at)brookhurstdata(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2018-06-27 19:53:13 Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function
Previous Message Jerry Sievers 2018-06-27 19:38:53 Re: Space Stalker in SQL Output