Search Postgresql Archives

Re: Space Stalker in SQL Output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx
Mobile: 314-486-3261

On 2018-06-27 14:38, Jerry Sievers wrote:
Susan Hurst <susan.hurst@xxxxxxxxxxxxxxxxxx> 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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux